:root{font-family:-apple-system,BlinkMacSystemFont,"Yu Gothic UI",sans-serif;color:#223834;background:#f3f5f1;--accent:#284f4b;--zoom:.4}*{box-sizing:border-box}body{margin:0;padding:env(safe-area-inset-top) 0 calc(82px + env(safe-area-inset-bottom));}header{max-width:1100px;margin:auto;padding:22px 20px 14px;display:flex;justify-content:space-between;align-items:center}h1{font-size:22px;letter-spacing:.04em;margin:0}h1 span{font-size:10px;display:inline-block;margin-left:9px;background:#e2eae1;padding:4px 7px;border-radius:20px;vertical-align:middle}header p{font-size:12px;color:#6a7770;margin:7px 0 0}h2{font-size:18px;margin:0}button,select,input,textarea{font:inherit}button,select{min-height:42px;border-radius:10px;border:1px solid #ccd6cc;background:#fff;color:#29443c;padding:8px 12px;cursor:pointer}button:disabled{opacity:.45;cursor:default}button:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #82b7a2;outline-offset:2px}.primary{background:var(--accent);color:white;border-color:var(--accent);font-weight:600}.quiet{background:transparent;border-color:transparent}.danger{color:#a13b39}.full{width:100%;margin-top:12px}.savebar{display:flex;align-items:center;gap:7px;padding:8px 18px;background:#e9eee7;max-width:1100px;margin:auto;font-size:11px;min-height:46px}.savebar button{margin-left:auto;font-size:12px;min-height:32px;padding:4px 10px}.dot{width:6px;height:6px;background:#568d71;border-radius:50%;flex-shrink:0}main{max-width:1100px;margin:auto;padding:20px}section[hidden]{display:none}.sectionhead,.dialoghead{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}.hint{color:#6b776f;font-size:12px;line-height:1.7}.localnote{font-size:12px;line-height:1.8;text-align:center;color:#65756b;margin:22px 0}textarea{display:block;width:100%;resize:vertical;min-height:260px;line-height:1.8;border:1px solid #ccd6cc;border-radius:12px;padding:16px;background:#fff;color:#243d33;font-size:16px}#memo{height:45dvh;min-height:260px}.fileactions{display:flex;justify-content:space-between;gap:8px;margin-top:14px}.tabs{position:fixed;bottom:0;left:0;right:0;background:#fffefb;border-top:1px solid #dce3d8;padding:8px 12px calc(8px + env(safe-area-inset-bottom));display:flex;justify-content:center;gap:8px;z-index:5}.tabs button{flex:1;max-width:240px;border:0;background:transparent;color:#6c786f;min-height:44px}.tabs button[aria-current]{background:#e7eee4;color:#284f4b;font-weight:700}.pagebar{display:flex;align-items:center;justify-content:center;gap:8px}.pagebar select{flex:1;max-width:360px;min-width:0}#sheetLabel{flex:1;text-align:center}.tools{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:12px 0}.tools button{font-size:12px;min-height:38px}#zoomLabel{font-size:12px;min-width:34px}.paperhint{margin:5px 0 10px}#paperScroll{height:53dvh;min-height:300px;overflow:auto;background:#dce0d9;border-radius:12px;overscroll-behavior:contain}#paper{display:block;width:calc(1600px * var(--zoom));height:calc(1932px * var(--zoom));touch-action:none}#overviewScroll{overflow:auto;background:#e3e7df;border-radius:12px;margin-top:14px;padding:10px;max-height:65dvh}#overview{display:block;width:100%;height:auto;background:white}#overview.expanded{width:1754px;max-width:none}.selection{display:flex;gap:8px;margin-top:10px}.selection select{flex:1;min-width:0;font-size:13px}details{margin-top:14px;border-top:1px solid #dce3d8;padding-top:14px}summary{font-size:13px;color:#506558;cursor:pointer}dialog{border:0;border-radius:18px;padding:22px;max-width:550px;width:calc(100% - 24px);max-height:90dvh;overflow:auto;box-shadow:0 20px 80px #182a3540;color:#253b32}dialog::backdrop{background:#132b3266}#editor textarea{height:28dvh;min-height:150px}label{font-size:12px;display:block;margin-bottom:6px}.editrow{display:flex;align-items:end;gap:12px;margin:12px 0}.editrow label{flex:1;min-width:0}.editrow input,.editrow select{display:block;width:100%;font-size:16px;margin-top:6px}.editrow input{border:1px solid #ccd6cc;border-radius:10px;min-height:42px;padding:8px}dialog p{font-size:13px;line-height:1.9}#downloadArea{background:white;padding:16px;border-radius:12px;font-size:13px}#downloadImage{display:block;max-width:100%;margin-top:12px}a{color:#285c4c}#lineTool[aria-pressed=true]{background:#284f4b;color:white}.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}@media(min-width:760px){main{padding:24px 40px}#memoView{max-width:760px;margin:auto}#paperScroll{height:62dvh}header{padding:24px 40px}.savebar{padding-left:40px;padding-right:40px}}@media(max-width:430px){main{padding:16px 12px}header{padding:18px 16px 12px}h1{font-size:20px}#editor{margin:auto auto 0;width:100%;max-width:100%;border-radius:20px 20px 0 0;padding-bottom:calc(20px + env(safe-area-inset-bottom))}.tools{gap:6px}.tools button{padding:7px 10px}}

/* 作業面を広くするコンパクト表示 */
main{padding:10px 12px 14px}.sectionhead{gap:6px;margin-bottom:8px;min-height:36px}.sectionhead h2{flex:1;font-size:18px;white-space:nowrap}.sectionhead button{min-height:36px;padding:6px 10px;font-size:13px}.sectionhead .help-icon{width:36px;min-width:36px;font-size:18px;padding:4px}
#memo{height:calc(100dvh - 230px - env(safe-area-inset-top) - env(safe-area-inset-bottom));min-height:260px;padding:12px;line-height:1.75}.full{margin-top:10px}.fileactions{display:grid;grid-template-columns:auto 1fr auto;gap:8px;margin-top:8px}.fileactions button{font-size:13px;padding:8px 10px}.fileactions #saveProject{min-width:64px}.memo-help{margin-top:12px;padding-top:10px}.memo-help p{margin:8px 0}
.tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 6px;padding:5px 12px calc(4px + env(safe-area-inset-bottom))}.tabs button{min-height:40px;max-width:none;padding:6px}.appfoot{grid-column:1/-1;display:flex;align-items:center;gap:10px;justify-content:space-between;min-height:20px;padding:3px 3px 0;color:#748078;font-size:9px;line-height:1.5}.appfoot #saveStatus{flex:1;overflow-wrap:anywhere}.appfoot h1{margin:0;font-size:9px;font-weight:400;letter-spacing:0;white-space:nowrap;color:#748078}
.tools{margin:8px 0;gap:6px}.tools button{min-height:40px;padding:7px 10px}.pagebar{gap:6px}.pagebar button,.pagebar select{min-height:40px}.selection{margin-top:8px}.selection button,.selection select{min-height:40px}#paperScroll{height:calc(100dvh - 260px - env(safe-area-inset-top) - env(safe-area-inset-bottom));min-height:280px;border-radius:10px}#paperStage{position:relative;width:calc(1600px * var(--zoom));height:calc(1932px * var(--zoom))}
.resize-handle{position:absolute;display:grid;place-items:center;width:48px;height:48px;min-height:48px;padding:8px;border:0;border-radius:0;background:transparent;transform:translate(-50%,-50%);touch-action:none;cursor:nwse-resize;z-index:2}.resize-handle[hidden]{display:none}.resize-handle span{display:grid;place-items:center;width:28px;height:28px;border:1.5px solid #fff;border-radius:50%;background:#357c67;color:#fff;font-size:21px;line-height:1;box-shadow:0 1px 4px #183e3426;pointer-events:none}.resize-handle:active span{background:#234f42}.shape-controls{display:flex;align-items:center;gap:10px;margin-top:12px}.shape-controls>span{font-size:12px}.shape-controls button{min-height:42px;flex:1;font-size:13px}#shapeNote{margin:6px 0 10px}
@media(min-width:760px){main{padding:12px 40px 20px}#memo{height:calc(100dvh - 240px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}#paperScroll{height:calc(100dvh - 250px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}.tabs{padding-left:max(12px,calc((100vw - 750px)/2));padding-right:max(12px,calc((100vw - 750px)/2))}}

/* 原稿を大きく表示・ページ操作は右上のメニューへ */
#paperScroll{height:calc(100dvh - 245px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}.pagebar #pageMenu{font-size:22px;min-width:40px;padding:4px 8px}.selection #expandPaper{font-size:12px;white-space:nowrap;padding:6px 9px}.action-group{padding:12px 0;border-top:1px solid #e0e6dd}.action-group h3{font-size:13px;margin:0 0 10px;color:#6b776f}.action-group>button{display:block;width:100%;margin:8px 0}.action-group .tools{margin-bottom:0}#zipReady[hidden]{display:none}
body.paper-expanded{overflow:hidden}body.paper-expanded .tabs{display:none}#layoutView.paper-expanded{position:fixed;inset:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);z-index:10;background:#f3f5f1;padding:8px;display:flex;flex-direction:column;overflow:hidden}#layoutView.paper-expanded .pagebar,#layoutView.paper-expanded .tools,#layoutView.paper-expanded .selection{flex-shrink:0}#layoutView.paper-expanded #paperScroll{height:auto;flex:1;min-height:0}#layoutView.paper-expanded .selection{margin-bottom:0}
@media(min-width:760px){#paperScroll{height:calc(100dvh - 235px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}}

#overview.expanded.portrait{width:1240px}
