/* TSUNAGITE v23 unified 27-book reader, WCAG-aware contrast */
:root{--navy:#123a58;--deep:#09283f;--blue:#1477a6;--sky:#e5f4fb;--orange:#c85b0b;--red:#bb343b;--line:#ccdce6;--linegreen:#087945;--focus:#f5a223;color-scheme:light}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:#f1f6f9;color:var(--deep);font-family:system-ui,-apple-system,'Noto Sans JP','Yu Gothic','Meiryo',sans-serif;font-size:16px;line-height:1.65}
button,a{font:inherit}button{cursor:pointer}a{color:var(--blue)}:focus-visible{outline:3px solid var(--focus);outline-offset:3px}.skip{position:absolute;left:-10000px;top:auto}.skip:focus{left:15px;top:15px;z-index:10000;padding:12px;background:#fff}
.site-head{background:#fff;border-bottom:1px solid var(--line);box-shadow:0 2px 12px #123a5810}.head-inner{max-width:1320px;margin:auto;padding:14px clamp(14px,2.4vw,30px);display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}.brand{text-decoration:none;color:var(--navy);font-weight:900;font-size:clamp(22px,3vw,29px);letter-spacing:.05em;line-height:1.1}.brand img{display:block;width:auto;max-width:min(230px,65vw);height:40px;object-fit:contain;margin:0 0 3px}.brand small{display:block;font-weight:700;font-size:12px;letter-spacing:.13em;color:#35647e;margin-top:5px}.head-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.plain-link{color:var(--navy);border:1px solid var(--line);text-decoration:none;padding:9px 13px;border-radius:9px;font-size:14px;font-weight:750;background:#fff}.plain-link:hover{background:#e7f4fb}.line-link{background:var(--linegreen);color:white!important;border:1px solid var(--linegreen);text-decoration:none;padding:11px 18px;border-radius:10px;font-weight:900;font-size:16px;display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:49px}.line-link:hover{background:#076639}.line-link:focus-visible{outline-color:#e89b14}
main{max-width:1320px;margin:0 auto;padding:clamp(13px,2.2vw,25px)}.reader-heading{margin:0 auto 16px;padding:22px clamp(16px,3vw,31px);background:linear-gradient(113deg,#113955,#0d7095);color:white;border-radius:16px;display:grid;grid-template-columns:1fr auto;gap:18px;align-items:center}.eyebrow{font-size:13px;letter-spacing:.16em;color:#c7ecfa;font-weight:850;margin:0 0 6px}.reader-heading h1{font-weight:900;font-size:clamp(24px,3.3vw,37px);line-height:1.4;margin:0}.reader-heading p{color:#f1fbff;margin:8px 0 0;max-width:850px;font-size:15px}.reader-heading .cta-col{display:flex;flex-direction:column;gap:7px;text-align:center}.reader-heading .cta-col small{font-weight:700;font-size:13px;color:#e4f2f7}
.reader-wrapper{background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:0 14px 36px #00264212;overflow:hidden}.reader-label{display:flex;justify-content:space-between;gap:10px;align-items:center;background:#ddecf5;color:var(--navy);padding:11px 18px;font-weight:850;flex-wrap:wrap}.reader-label .page-index{font-size:16px;color:#1f4e69}.reader-hint{font-size:14px;color:#285773}.reader-viewport{position:relative;padding:12px 70px 10px;background:linear-gradient(135deg,#c6ddea,#e6f1f6);min-height:180px;scroll-margin-top:20px}.page-scroll{overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;border-radius:8px;touch-action:pan-x pan-y}.page-surface{display:flex;justify-content:center;align-items:stretch;gap:0;width:100%;min-width:100%;margin:auto;filter:drop-shadow(0 6px 13px #0b2b4155);transition:width .12s ease-out;}
.page-panel{display:flex;align-items:stretch;justify-content:center;position:relative;width:50%;min-width:0;min-height:100px;aspect-ratio:595/842;background:#fff;border:1px solid #bdd0dd}.page-panel img{display:block;width:100%;height:100%;object-fit:contain}.page-panel img[hidden]{display:none!important}.page-panel.is-empty{background:#e6edf2;box-shadow:inset 0 0 0 2px #dae5eb}.page-panel:not(.is-empty){cursor:zoom-in}.page-panel.is-empty::after{content:' ';display:block}.page-panel.left{border-radius:8px 0 0 8px}.page-panel.right{border-radius:0 8px 8px 0}.book-gutter{position:absolute;inset:0 auto 0 50%;width:2px;background:#113a5950;pointer-events:none;z-index:2}
.edge-arrow{position:absolute;z-index:5;top:46%;transform:translateY(-50%);width:54px;height:74px;border:0;border-radius:13px;background:#113e60;color:#fff;font-size:35px;font-weight:900;box-shadow:0 4px 14px #0003;cursor:pointer}.edge-prev{left:10px}.edge-next{right:10px}.edge-arrow:hover:not(:disabled){background:#006b9e}.edge-arrow:disabled,.control-btn:disabled{opacity:.38;cursor:not-allowed}
.control-bar{background:#fff;padding:14px 18px;border-top:1px solid var(--line);display:grid;grid-template-columns:1fr auto 1fr;gap:12px;align-items:center}.control-btn{display:inline-flex;align-items:center;justify-content:center;padding:10px 12px;min-height:47px;border-radius:10px;border:1px solid #92b6c9;background:#f2f9fd;font-size:15px;font-weight:850;color:#124665;cursor:pointer;text-decoration:none}.control-btn:hover:not(:disabled){background:#d7edf8}.control-btn.main{background:#124b70;color:#fff;border-color:#124b70}.left-controls,.right-controls{display:flex;gap:7px;align-items:center;flex-wrap:wrap}.right-controls{justify-content:end}.counter{color:var(--navy);font-size:17px;font-weight:900;white-space:nowrap}.zoom-number{color:#194c65;min-width:50px;text-align:center;font-weight:850;font-size:14px}.secondary-controls{padding:0 18px 16px;display:flex;gap:9px;flex-wrap:wrap;justify-content:center}.secondary-controls .control-btn{background:#fff}.secondary-controls .control-btn.line-small{color:white;background:var(--linegreen);border-color:var(--linegreen)}
.panel{background:#fff;border:1px solid var(--line);border-radius:14px;padding:clamp(16px,2vw,26px);margin:17px 0}.panel h2{color:var(--navy);font-size:clamp(20px,2.1vw,25px);margin:0 0 13px;font-weight:900}.panel p{margin:0 0 9px}.thumb-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:10px}.thumb{border:1px solid #aac9db;border-radius:10px;background:#f3f9fc;padding:7px;color:#143e58;min-width:0;font-weight:850;font-size:13px;line-height:1.5;cursor:pointer}.thumb[aria-current=page]{outline:3px solid #0c83b1;background:#e6f6fd}.thumb img{display:block;width:100%;height:145px;object-fit:contain;background:white;border-radius:5px;margin:0 0 5px}.thumb span{display:block;text-align:center}.related-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.related-card{display:flex;align-items:center;gap:12px;text-decoration:none;color:var(--navy);background:#f1f8fc;border:1px solid #bed6e6;border-radius:12px;padding:11px;min-height:100px}.related-card img{height:100px;width:68px;object-fit:contain;background:white;border-radius:4px}.related-card strong{font-size:15px;line-height:1.5;display:block;overflow-wrap:anywhere}.related-card small{font-size:13px;color:#315d77}.related-card:hover{border-color:#1681b1}.bottom-cta{padding:24px;background:#e9f4f9;border:1px solid #b8d8e6;border-radius:16px;margin:17px 0 30px;text-align:center}.bottom-cta h2{margin:0 0 9px;font-size:24px;color:var(--navy)}.bottom-cta p{margin:0 0 15px}.bottom-cta-links{display:flex;justify-content:center;gap:11px;flex-wrap:wrap}.bottom-cta .plain-link{background:#fff}.site-footer{text-align:center;color:#355870;font-size:14px;padding:24px 18px;border-top:1px solid var(--line)}.site-footer a{font-weight:750}.text-details{margin-top:17px}.text-details summary{cursor:pointer;font-size:17px;font-weight:900;color:var(--navy)}.text-pages{display:grid;gap:12px;margin-top:15px}.text-page{padding:14px;border-radius:10px;background:#f6fafc;border:1px solid #d9e5eb}.text-page h3{margin:0 0 8px;font-size:16px}.text-page pre{font:inherit;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.8;font-size:14px;margin:0}
@media(max-width:980px){.thumb-grid{grid-template-columns:repeat(6,minmax(0,1fr))}.related-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.reader-heading{grid-template-columns:1fr}.reader-heading .cta-col{align-items:start}}
@media(max-width:680px){main{padding:9px}.head-inner{padding:11px}.reader-heading{border-radius:12px;padding:17px}.reader-heading h1{font-size:25px}.reader-viewport{padding:8px 43px}.edge-arrow{height:55px;width:38px;font-size:27px;top:46%}.edge-prev{left:3px}.edge-next{right:3px}.reader-label{padding:10px 12px}.reader-hint{font-size:12px}.control-bar{padding:10px;grid-template-columns:1fr auto 1fr;gap:5px}.left-controls,.right-controls{gap:3px}.control-btn{min-height:44px;padding:8px;font-size:13px}.counter{font-size:13px}.secondary-controls{padding:0 10px 12px;gap:5px}.secondary-controls .control-btn{font-size:13px;min-height:43px;flex:1 1 auto}.zoom-number{min-width:40px;font-size:12px}.thumb-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}.thumb img{height:105px}.thumb{padding:5px;font-size:12px}.related-grid{grid-template-columns:1fr}.reader-heading .cta-col{width:100%}.reader-heading .cta-col .line-link{width:100%}.page-panel{min-height:70px}.panel{padding:13px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}.page-surface{transition:none}}

/* v23 additional visual consistency */
.site-head .brand img{height:auto;width:185px;max-height:46px;object-fit:contain;margin:0 0 5px}
.site-head .brand small{font-size:13px;color:#1f4e69;letter-spacing:.055em}
.site-head .head-inner{max-width:1260px}
.site-head .head-actions{gap:7px}
.site-head .head-actions a{min-height:44px}
.reader-note{margin:12px 0;padding:14px 18px;background:#fff7e8;border:1px solid #daa454;border-left:5px solid #c85b0b;border-radius:12px;display:flex;gap:10px 16px;align-items:flex-start;flex-wrap:wrap;color:#3b2a14;font-size:15px;line-height:1.7}
.reader-note strong{white-space:nowrap;color:#823b0b}
.site-footer{background:#09283f;color:#fff;padding:28px 16px}
.site-footer .footer-inner{max-width:1130px;margin:auto}
.site-footer .footer-logo{font-size:19px;color:#fff;text-decoration:none;font-weight:900}
.site-footer p{font-size:15px;color:#e5f4fa;margin:9px 0 15px}
.site-footer p span{margin-left:12px}
.site-footer nav{display:flex;flex-wrap:wrap;gap:10px 23px;margin-bottom:15px}
.site-footer nav a{color:#fff;text-decoration:underline;text-underline-offset:4px;font-size:14px;font-weight:750}
.site-footer small{color:#b9d8e7;font-size:13px}
.thumb{font-size:14px}.thumb[aria-current=page]{outline-color:#124b70;border-color:#124b70}
.related-card small{font-size:14px;color:#214760}
.reader-heading .eyebrow{color:#d5f4ff}
.text-page pre{font-size:15px;color:#16354c}
@media(max-width:680px){.site-head .brand img{width:160px}.site-head .brand small{font-size:12px}.site-head .head-actions{width:100%}.site-head .head-actions .plain-link{padding:8px;font-size:13px;flex:1 1 auto}.site-head .head-actions .line-link{flex:1 1 100%}.reader-note{font-size:14px;padding:11px}.site-footer p span{display:block;margin-left:0}.site-footer nav a{font-size:14px}.thumb{font-size:13px}}
