:root{color-scheme:light;--navy:#192c45;--gold:#b38a41;--ink:#243850;--muted:#65758b;--line:#dce3eb;--bg:#f3f5f7}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.6 'Yu Gothic UI','Meiryo',system-ui,sans-serif}button,input,select{font:inherit}button{cursor:pointer;border:1px solid var(--line);border-radius:9px;background:#fff;color:var(--ink);padding:9px 15px;font-size:14px;transition:background .15s,box-shadow .15s}button:hover:not(:disabled){background:#f0f3f7;box-shadow:0 2px 6px #182b4210}button:disabled{cursor:default;opacity:.38}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #b38a4190;outline-offset:3px}.primary{background:var(--navy);color:#fff;border-color:var(--navy);padding:12px 22px}.primary:hover:not(:disabled){background:#2e4562}.sidebar{width:230px;position:fixed;inset:0 auto 0 0;background:var(--navy);color:#c8d3e1;padding:30px 22px;display:flex;flex-direction:column}.brand{color:#e4c17b;font-size:40px;font-weight:750;text-decoration:none;letter-spacing:1.5px;line-height:1.4}.brand span{display:block;font-size:12px;font-weight:400;letter-spacing:2px;color:#adbbcc;margin-top:5px}.nav-label{font-size:12px;letter-spacing:2px;color:#91a0b4;margin:52px 12px 16px}.sidebar nav{display:grid;gap:8px}.nav{display:flex;align-items:center;gap:13px;background:none;border:0;color:#d3dce7;text-align:left;padding:14px 12px;border-left:3px solid transparent}.nav span{font-size:12px;color:#a6b4c7}.nav.active{background:#ffffff13;border-left-color:#d4b16c;color:#f1d79d}.nav:hover:not(:disabled){background:#ffffff0c}.sidebar-bottom{margin-top:auto;padding-top:35px}.ghost{background:none;color:inherit;border-color:#ffffff30;width:100%}.sidebar-bottom p{font-size:12px;margin-top:25px}.sidebar-bottom small{font-size:12px;color:#9aabc1}.privacy-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:#d8b572;margin-right:6px}main{margin-left:230px;padding:32px 40px 22px;max-width:1900px}header{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:24px}.eyebrow{font-size:12px;letter-spacing:2.5px;color:#99732e}h1{font-size:29px;letter-spacing:.03em;line-height:1.4;margin:6px 0}header p{font-size:14px;color:var(--muted);margin:0}.top-actions{display:flex;justify-content:space-between;gap:12px;margin-bottom:22px}.top-actions>div{display:flex;gap:10px}.workspace{background:#fff;border:1px solid var(--line);border-radius:14px;overflow:hidden;min-height:64vh;display:flex;flex-direction:column}.tab-bar{display:flex;justify-content:space-between;gap:8px;background:#fafbfd;border-bottom:1px solid var(--line);padding:0 14px}#tabs{display:flex;gap:3px;overflow-x:auto}.tab{white-space:nowrap;display:flex;align-items:center;border:0;background:none;border-radius:0;border-top:3px solid transparent;padding:12px 14px;gap:18px}.tab[aria-selected=true]{border-top-color:var(--gold);background:#fff;color:#182d49}.close-tab{padding:0 3px;color:#758398}.text-button{background:none;border-color:transparent}.workspace-top{display:flex;justify-content:space-between;font-size:13px;color:var(--muted);padding:17px 22px 8px}#dropzone{margin:0 16px;min-height:420px;flex:1;border:2px dashed transparent;border-radius:10px;background:#f7f9fc;position:relative}#dropzone.dragover{border-color:var(--gold);background:#fcf7ed}#empty{text-align:center;padding:35px 20px;display:flex;align-items:center;flex-direction:column}#empty h2{font-size:23px;margin:20px 0 8px}#empty p{color:var(--muted);font-size:14px;margin:0 0 23px}#empty small{font-size:12px;color:var(--muted);margin-top:16px}#sample{font-size:13px;margin-top:8px}.paper-art{position:relative;width:124px;height:112px}.paper-art span{position:absolute}.back-paper{width:67px;height:86px;border:1px solid #cdd8e4;border-radius:7px;background:#eef2f6;left:18px;top:6px;transform:rotate(-14deg)}.front-paper{width:72px;height:93px;background:white;border:1px solid #c4cfdd;left:38px;top:12px;border-radius:7px;transform:rotate(7deg);padding:14px 12px;text-align:left;box-shadow:0 8px 15px #20344a09}.front-paper b{font-size:14px;color:#9b793d}.front-paper i{display:block;height:3px;background:#dfe5ed;margin:8px 0;width:85%}.plus-badge{bottom:-2px;right:0;background:var(--navy);color:#edcf91;border:3px solid #f7f9fc;width:35px;height:35px;border-radius:50%;line-height:27px}.selection-bar{display:flex;justify-content:space-between;gap:10px;padding:18px 20px;flex-wrap:wrap}.selection-bar>div{display:flex;gap:8px;flex-wrap:wrap}.danger{color:#b74949}.bottom-note{display:flex;justify-content:space-between;gap:20px;font-size:12px;color:var(--muted);margin:14px 0}.backup-option{font-size:13px;color:var(--muted);display:flex;align-items:center;gap:8px;flex-wrap:wrap}.backup-option input{accent-color:var(--navy);width:16px;height:16px}.backup-option span{font-size:12px}.page-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(165px,1fr));gap:18px;padding:18px}.page-card{position:relative;padding:12px 12px 10px;border:2px solid transparent;border-radius:10px;cursor:pointer;min-width:0}.page-card.selected{border-color:var(--gold);background:#f3ebdb70}.page-card.drag-target{border-color:var(--navy)}.thumb{height:200px;display:flex;align-items:center;justify-content:center}.thumb canvas{max-width:100%;max-height:100%;background:white;box-shadow:0 3px 12px #243b5720}.page-caption{display:flex;align-items:center;gap:8px;margin-top:12px;font-size:12px}.page-caption strong{font-size:14px;font-weight:500}.page-caption span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted)}.page-card input{position:absolute;left:17px;top:16px;width:17px;height:17px;accent-color:var(--gold)}#tool-panel{padding:16px 24px;margin:6px 16px 16px;border:1px solid #e4d7bc;background:#fffcf5;border-radius:10px}#tool-panel h2{font-size:17px;margin:0 0 8px}.tool-fields{display:flex;align-items:end;gap:16px;flex-wrap:wrap}.tool-fields label{display:grid;gap:4px;font-size:13px}.tool-fields input,.tool-fields select{padding:9px 11px;border:1px solid var(--line);border-radius:7px;background:white;max-width:100%;min-width:130px;font-size:14px}.tool-hint{font-size:13px;color:var(--muted);margin:10px 0 0}.banner{padding:12px 18px;background:#fff6de;border:1px solid #e4c782;border-radius:8px;margin-bottom:16px;font-size:14px}.banner button{margin-left:10px}dialog{border:1px solid var(--line);border-radius:14px;max-width:min(820px,94vw);width:640px;color:var(--ink);padding:25px}dialog::backdrop{background:#14223880}.modal-head{display:flex;align-items:center;justify-content:space-between;gap:15px}.modal-head h2{font-size:21px;margin:0 0 15px}.modal-head button{font-size:22px;padding:0 9px}#modal-body p,#modal-body li{font-size:14px}#modal-body canvas{max-width:100%;max-height:70vh;display:block;margin:auto}#modal-body a{color:#775b25}#busy{position:fixed;inset:0;background:#192c4580;z-index:20;display:grid;place-items:center}.busy-box{background:white;padding:35px 45px;border-radius:14px;text-align:center}.spinner{display:inline-block;width:30px;height:30px;border:3px solid #e5e9ee;border-top-color:var(--gold);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}#toast{position:fixed;bottom:30px;left:50%;transform:translateX(-50%);z-index:30;background:#192c45;color:white;box-shadow:0 8px 30px #0003;border-radius:10px;padding:15px 24px;max-width:90vw;font-size:14px}[hidden]{display:none!important}@media(min-width:1500px){.thumb{height:240px}.page-grid{grid-template-columns:repeat(auto-fill,minmax(200px,1fr))}}@media(max-width:1050px){.sidebar{width:200px;padding:24px 15px}main{margin-left:200px;padding:25px 22px}.top-actions{flex-wrap:wrap}header{align-items:start}header .primary{padding:10px 14px}.selection-bar{padding:14px}}@media(max-width:760px){.sidebar{position:static;width:100%;padding:15px 18px}.brand{font-size:28px;display:flex;align-items:center;gap:13px}.brand span{font-size:10px;margin:0}.nav-label,.sidebar-bottom{display:none}.sidebar nav{display:flex;overflow-x:auto;margin-top:15px;gap:6px}.nav{white-space:nowrap;padding:9px 12px;font-size:13px}.nav span{display:none}main{margin:0;padding:20px 14px}header{flex-wrap:wrap;margin-bottom:18px}h1{font-size:24px}.eyebrow{font-size:10px}header .primary{width:100%}.top-actions>div{flex-wrap:wrap;gap:6px}.top-actions button{font-size:13px;padding:8px 10px}.tab-bar{padding:0 5px}.tab{padding:10px 8px;gap:7px;font-size:13px}#new-tab{white-space:nowrap;font-size:12px;padding:6px}.workspace-top{padding:14px 13px 6px;font-size:12px}.page-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding:8px}.thumb{height:160px}.page-card{padding:9px 7px}.selection-bar button{font-size:12px;padding:7px 8px}#dropzone{margin:0 8px;min-height:350px}#empty{padding:30px 10px}.bottom-note{flex-direction:column;gap:3px}#tool-panel{margin:5px 8px 12px;padding:14px}.tool-fields{gap:10px}.tool-fields label{flex:1;min-width:130px}.tool-fields button{width:100%}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
:root{--preview-edge:#d4dde7}
.brand{cursor:default;user-select:none}
.download-icon{display:inline-block;width:22px;height:22px;object-fit:contain;vertical-align:middle;margin-right:6px}
.primary .download-icon{filter:invert(1);mix-blend-mode:screen}
.icon-download{min-width:46px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;padding:10px!important;flex:0 0 auto!important;width:46px!important}
.icon-download .download-icon{margin:0;width:24px;height:24px}
.selection-bar{padding:12px 20px!important;border-bottom:1px solid var(--line);margin-bottom:12px}
.thumb img{max-width:100%;max-height:100%;background:#fff;box-shadow:0 3px 12px #243b5720;pointer-events:none;user-select:none;object-fit:contain}
.tab-bar{min-width:0}.tab{max-width:240px;flex:0 1 240px;min-width:95px;gap:10px!important}.tab-name{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.close-tab,.dirty-marker{flex-shrink:0}.dirty-marker{color:var(--gold)}
.file-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(155px,1fr));gap:20px;padding:25px}
.file-card{min-width:0;text-align:center;padding:12px}.file-card .thumb{height:150px;margin-bottom:12px}.file-name{font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-size{font-size:12px;color:var(--muted);margin-top:3px}
.help-toggle{font-size:12px;color:#b7c3d3}.help-toggle summary{cursor:pointer;width:fit-content;padding:3px 0}.help-toggle #help-content{max-height:42vh;overflow:auto;padding-right:5px}.help-toggle p{font-size:12px!important;margin:10px 0!important;line-height:1.7}.help-toggle a{color:#e0c690}.save-form label{display:grid;gap:7px}.save-form input{padding:10px;border:1px solid var(--line);border-radius:7px;min-width:0;width:100%;margin-bottom:18px}.save-form>div{display:flex;justify-content:end;gap:10px}
@media(max-width:760px){.sidebar .sidebar-bottom{display:block;padding:0;margin-top:8px}.sidebar-bottom>p,.sidebar-bottom>small{display:none}.sidebar-bottom .help-toggle #help-content{max-height:28vh}.tab{max-width:150px;min-width:80px}.selection-bar{padding:10px!important}.file-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:12px}.file-card{padding:8px}.file-card .thumb{height:145px}.download-icon{width:20px;height:20px}}

/* 1.0.1 */
#help.help-toggle{display:block;width:100%;margin:28px 0 0;padding:16px 20px;border:1px solid var(--line);border-radius:10px;background:white;color:var(--ink)}
#help #help-content{max-height:none!important;overflow:visible!important;font-size:14px;color:var(--muted)}
#help summary{font-size:14px;cursor:pointer}#help a{color:#775b25}
#save:not(:disabled),.icon-download:not(:disabled){background:#526e8a;border-color:#526e8a;color:white}
#save:hover:not(:disabled),.icon-download:hover:not(:disabled){background:#2e4562;border-color:#2e4562}
.primary .download-icon{filter:invert(1) drop-shadow(.6px 0 0 white) drop-shadow(-.6px 0 0 white)}
#release-notes{background:transparent;color:#e4c17b;border-color:#ffffff30;display:inline-flex;align-items:center}
.special-message{white-space:pre-line;line-height:1.8}.special-filename{overflow-wrap:anywhere;font-weight:600}.dialog-actions{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}.special-form input{display:block;width:100%;padding:10px;border:1px solid var(--line);border-radius:8px}.special-form label{font-size:14px}
.conversion-switch{display:flex;align-items:center;gap:10px;margin:14px 0;flex-wrap:wrap;font-size:14px}
#conversion-direction{width:48px;height:28px;padding:3px;border:0;border-radius:20px;background:#8898a9;flex-shrink:0}#conversion-direction span{display:block;background:#fff;width:22px;height:22px;border-radius:50%;transition:transform .15s}#conversion-direction[aria-checked=true]{background:#526e8a}#conversion-direction[aria-checked=true] span{transform:translateX(20px)}
@media(max-width:760px){.sidebar-bottom{display:flex!important;justify-content:flex-end;padding-top:8px}.sidebar-bottom p,.sidebar-bottom small{display:none}#help.help-toggle{padding:14px}#new-tab{font-size:11px}}

.primary .download-icon{filter:none;mix-blend-mode:normal}#help #help-content p{font-size:14px!important}

/* Keep editing controls outside the scrollable page list. */
.workspace.editing{height:clamp(420px,calc(100dvh - 250px),1000px);min-height:0}
.workspace.editing>.tab-bar,.workspace.editing>.workspace-top,.workspace.editing>.selection-bar{flex-shrink:0}
.workspace.editing #dropzone{min-height:0;overflow:auto;overscroll-behavior:contain;overflow-anchor:none;scrollbar-gutter:stable;margin-bottom:16px}
.workspace.editing .selection-bar{background:white;margin-bottom:0}
@media(max-width:760px){.workspace.editing{height:calc(100dvh - 24px);min-height:420px}.workspace.editing #dropzone{margin-bottom:8px}}

/* 1.0.3: use the viewport for documents rather than header spacing. */
main{padding:14px 24px 20px}
header{gap:12px;margin-bottom:8px;min-height:42px}
header .eyebrow{display:none}header h1{font-size:22px;line-height:1.3;margin:0}header p{font-size:13px;margin:2px 0 0}
header .primary{padding:8px 14px;font-size:13px;white-space:nowrap}
.top-actions{margin-bottom:8px;gap:8px}.top-actions>div{gap:6px}.top-actions button{padding:6px 10px;font-size:13px}
.workspace,.workspace.editing{height:calc(100dvh - 130px);min-height:400px}
.workspace>.tab-bar,.workspace>.workspace-top,.workspace>.selection-bar,.workspace>#tool-panel{flex-shrink:0}
.tab{padding:6px 10px;font-size:13px}.tab-bar #new-tab{padding:5px 8px}.workspace-top{padding:5px 14px;font-size:12px}
.selection-bar{padding:6px 12px!important;gap:6px}.selection-bar>div{gap:5px}.selection-bar button{padding:5px 9px;font-size:13px}
#dropzone,.workspace.editing #dropzone{min-height:0;overflow:auto;overscroll-behavior:contain;overflow-anchor:none;scrollbar-gutter:stable;margin:0 10px 10px;flex:1}
.page-grid{grid-template-columns:repeat(auto-fill,minmax(145px,1fr));gap:8px;padding:8px}
.page-card{padding:6px 8px}.page-card input{left:10px;top:9px;width:16px;height:16px}
.thumb{height:clamp(94px,calc((100dvh - 406px)/3),160px)}.page-caption{margin-top:5px;gap:5px;line-height:1.4}.page-caption strong{font-size:13px}
#tool-panel{padding:8px 12px;margin:2px 10px 8px}#tool-panel h2{font-size:15px;margin:0 0 5px}
.tool-fields{gap:8px 12px}.tool-fields label{gap:2px}.tool-fields input,.tool-fields select{padding:5px 8px;font-size:13px;min-width:110px}
.tool-hint{margin:5px 0 0;font-size:12px}.conversion-switch{margin:5px 0 8px;font-size:13px}
#tool-panel>p:not(.tool-hint){font-size:13px;margin:5px 0}.icon-download{min-height:34px;min-width:36px;width:36px!important;padding:6px!important}
.file-grid{gap:10px;padding:12px}.file-card{padding:6px}.file-card .thumb{height:clamp(90px,calc((100dvh - 440px)/3),140px);margin-bottom:5px}
.sidebar-bottom .desktop-note{display:block;font-size:11px;margin-top:4px;color:#9aabc1}
@media(max-width:760px){
 .sidebar{position:relative;padding:10px 14px}.sidebar .brand{font-size:25px}.sidebar nav{margin-top:8px}.sidebar .sidebar-bottom{position:absolute;right:14px;top:10px;padding:0!important;margin:0!important}.sidebar-bottom #release-notes{padding:5px}.sidebar-bottom .desktop-note{display:none}
 main{padding:10px}header{gap:6px}header h1{font-size:20px}header .primary{width:auto;padding:7px 9px;font-size:12px}header p{font-size:12px}
 .top-actions button{padding:5px 7px;font-size:12px}.workspace,.workspace.editing{height:calc(100dvh - 230px);min-height:440px}
 .page-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding:6px}.thumb{height:100px}
 .selection-bar{padding:5px 8px!important}.selection-bar button{font-size:12px;padding:5px 7px}
 .tool-fields{gap:6px}.tool-fields label{min-width:105px}.tool-fields button{width:auto}.tab{padding:6px;font-size:12px}
 #tool-panel{padding:7px 9px}#tool-panel h2{font-size:14px}.file-card .thumb{height:90px}
}
