:root{color-scheme:light;--ink:#28372d;--muted:#677062;--accent:#abcd03;--bg:#eeeee7;--line:#d6d9cb}
*{box-sizing:border-box}html,body{margin:0;width:100%;min-height:100%;font-family:-apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN","Noto Sans JP",sans-serif;color:var(--ink)}
body{height:100dvh;min-height:500px;background:var(--bg);display:flex;flex-direction:column;overflow:hidden}
button,input{font:inherit}button{cursor:pointer;color:inherit}button:disabled{cursor:default;opacity:.33}button:focus-visible,input:focus-visible{outline:3px solid #789300;outline-offset:4px}button{touch-action:manipulation}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 28px 14px;flex:none}.identity{display:flex;align-items:center;gap:13px;min-width:0}.brand-dot{width:11px;height:11px;background:var(--accent);border-radius:50%;flex:none}.eyebrow{font-size:10px;letter-spacing:.12em;color:var(--muted);margin:0 0 5px}h1{font-size:17px;letter-spacing:.05em;font-weight:500;margin:0;font-family:"Hiragino Mincho ProN","Yu Mincho",serif}.tool{display:flex;align-items:center;gap:7px;white-space:nowrap;padding:10px 15px;border:1px solid #c8cebd;border-radius:6px;background:transparent;font-size:12px;min-height:42px}.tool:hover{background:#fff8}
main{min-height:0;flex:1;display:flex;flex-direction:column}.stage{flex:1;min-height:0;position:relative;display:flex;align-items:center;justify-content:center;padding:14px 20px 8px;overflow:hidden;background:radial-gradient(ellipse at center,#f9f9f4 5%,#e9eae2 100%)}.mount{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.book{flex-shrink:0;transition:transform .52s ease}.sheet{background:white;overflow:hidden;border:1px solid #e1e3d8;box-shadow:0 5px 22px #45523b1f}.sheet img{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none;user-select:none}.sheet:after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,#d4d4c00a,transparent 5%,transparent 96%,#28351e0a)}
#loading{position:absolute;inset:45% 0 auto;text-align:center;color:var(--muted);font-size:13px;pointer-events:none}.ready #loading{display:none}.bottom-panel{flex:none;padding:8px 20px max(14px,env(safe-area-inset-bottom));background:#f4f4ef;border-top:1px solid #dfe1d5}.hint{font-size:11px;color:var(--muted);text-align:center;margin:0 0 10px;letter-spacing:.04em}.controls{display:flex;align-items:center;justify-content:center;gap:22px;max-width:670px;margin:auto}.page-button{border:1px solid #c9d0bd;border-radius:6px;background:white;min-width:93px;min-height:44px;display:flex;align-items:center;justify-content:center;gap:15px;font-size:13px}.page-button:hover:enabled{border-color:#91a476;background:#f9fbed}.page-button.next{background:#e8efc3;border-color:#b6c85f}.progress{min-width:120px;flex:1;max-width:330px;text-align:center}.progress output{font-size:12px;display:block;margin:0 0 5px;font-variant-numeric:tabular-nums}.progress input{width:100%;height:18px;margin:0;accent-color:#879d13;cursor:pointer}.secondary{display:flex;align-items:center;justify-content:center;gap:11px;margin-top:9px;color:var(--muted);font-size:10px}.text-button{border:0;background:none;padding:6px 8px;font-size:12px;min-height:32px}.text-button:hover{color:#41540b}
dialog{border:0;border-radius:10px;padding:0;box-shadow:0 18px 70px #1925173d;color:var(--ink);background:#f6f6f0}dialog::backdrop{background:#15211ac4;backdrop-filter:blur(3px)}.dialog-header{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#f6f6f0;padding:14px 20px;border-bottom:1px solid var(--line);flex:none}.dialog-header h2{font-size:14px;font-weight:500;margin:0}.close{border:0;background:transparent;font-size:28px;line-height:1;min-width:40px;min-height:40px}.toc-dialog{width:min(900px,calc(100vw - 32px));max-height:90dvh}.thumbnails{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:20px;padding:22px;overflow:auto;max-height:calc(90dvh - 70px)}.thumb{border:1px solid transparent;border-radius:6px;background:none;text-align:left;padding:8px;display:flex;flex-direction:column;gap:8px;line-height:1.5;font-size:11px}.thumb:hover,.thumb[aria-current=true]{border-color:#a4b84a;background:#ecf1d3}.thumb img{width:100%;height:auto;box-shadow:0 2px 7px #29331e17}.thumb small{font-size:10px;color:var(--muted)}.thumb span{font-size:11px}
.zoom-dialog{width:min(1120px,calc(100vw - 28px));height:94dvh;max-height:94dvh}.zoom-dialog[open]{display:flex;flex-direction:column}.zoom-scroll{overflow:auto;flex:1;min-height:0;overscroll-behavior:contain;background:#dcdfd5;padding:18px;text-align:center}.zoom-scroll>img{display:block;width:100%;max-width:1050px;height:auto;margin:0 auto;background:white;box-shadow:0 3px 12px #24301e26}.zoom-controls{display:flex;align-items:center;justify-content:center;gap:26px;flex:none;padding:10px;background:#f6f6f0;border-top:1px solid var(--line);font-size:12px}.zoom-controls button{background:white;border:1px solid #cbd0c1;border-radius:5px;padding:9px 14px;min-height:40px}.zoom-controls span{min-width:74px;text-align:center}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.no-js-page{max-width:90vw;max-height:70vh;object-fit:contain}.fallback .mount{overflow:auto;display:block}.fallback .sheet{width:min(95%,600px);height:auto;margin:16px auto}.fallback .sheet img{height:auto}.fallback .stage{overflow:auto}.fallback #loading{display:none}
@media(max-width:759px){body{min-height:480px}.topbar{padding:12px 14px 10px;gap:9px}.identity{gap:8px}.brand-dot{width:8px;height:8px}.eyebrow{font-size:8px;letter-spacing:.03em;margin-bottom:4px}h1{font-size:13px;letter-spacing:0}.tool{font-size:10px;padding:8px;min-height:40px;gap:4px}.stage{padding:6px 10px}.bottom-panel{padding:8px 16px max(10px,env(safe-area-inset-bottom))}.controls{gap:12px}.page-button{min-width:74px;gap:10px;min-height:42px;font-size:12px}.hint{font-size:10px;margin-bottom:9px}.secondary{margin-top:4px}.text-button{font-size:11px}.thumbnails{grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;padding:12px}.thumb{padding:5px}.zoom-scroll{padding:4px}.zoom-dialog{width:calc(100vw - 10px);height:97dvh;max-height:97dvh}.zoom-controls{gap:18px}.dialog-header{padding:8px 12px}.dialog-header h2{font-size:12px}}
@media(prefers-reduced-motion:reduce){.book{transition:none}*{scroll-behavior:auto!important}}
@media print{.topbar,.bottom-panel,dialog{display:none}body,main,.stage,.mount{height:auto;overflow:visible;background:white}.sheet{box-shadow:none;border:0;break-after:page}*{text-shadow:none!important;box-shadow:none!important}}
