:root {
  --navy:#17375f; --blue:#075b9a; --gold:#a76800; --paper:#fffef9;
  --ink:#172235; --line:#b9ad98; --green:#237858; --red:#b3332f;
  color-scheme:light;
}
* { box-sizing:border-box; }
html { scroll-behavior:smooth; scroll-padding-top:20px; }
body { margin:0; color:var(--ink); background:#f2efe7; font:16px/1.78 'Yu Gothic UI','Yu Gothic',Meiryo,sans-serif; }
a { color:var(--blue); text-underline-offset:3px; }
button,input { font:inherit; }
button { min-height:42px; border:1px solid #8b8070; border-radius:8px; padding:7px 14px; color:var(--navy); background:var(--paper); cursor:pointer; }
button:hover { background:#eee7d7; }
button:focus-visible,a:focus-visible,input:focus-visible,summary:focus-visible { outline:3px solid #b87925; outline-offset:3px; }
.language-bar { display:flex; justify-content:flex-end; gap:8px; padding:8px max(20px,calc((100vw - 1440px)/2 + 24px)); background:#eee8dc; border-bottom:1px solid var(--line); }
.language-bar button { border-radius:24px; min-height:34px; padding:4px 15px; font-size:.84rem; }
.language-bar [aria-pressed=true] { background:var(--navy); color:white; }
.hero { color:white; background:linear-gradient(118deg,#17375f,#1d3f6b); }
.hero-inner { max-width:1440px; margin:auto; padding:32px clamp(24px,5.2vw,80px) 34px; }
.edition { margin:0 0 8px; color:#f0e6d0; font-size:.88rem; letter-spacing:.04em; }
h1 { margin:0; font:700 clamp(2rem,4.1vw,3.45rem)/1.24 YuMincho,'Yu Mincho',serif; overflow-wrap:break-word; }
html[lang=en] h1 { font-size:clamp(1.8rem,3.7vw,3.25rem); }
.category-nav { border-bottom:1px solid #b0b8c3; background:var(--paper); box-shadow:0 3px 12px #14233c12; overflow-x:auto; }
.nav-inner { display:flex; flex-wrap:nowrap; gap:24px; width:max-content; min-width:min(100%,1440px); max-width:none; margin:auto; padding:10px clamp(24px,5.2vw,80px); }
.category-nav a { white-space:nowrap; font-weight:800; font-size:.92rem; text-decoration:none; padding:4px 0; border-bottom:2px solid transparent; }
.category-nav [aria-current=page] { border-color:var(--gold); color:var(--navy); }
.toolbar { max-width:1440px; margin:auto; padding:14px clamp(20px,4vw,56px); display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.toolbar-actions { display:flex; flex-wrap:wrap; gap:9px; }
.skip { position:absolute; left:12px; top:-80px; z-index:50; padding:8px; background:white; }
.skip:focus { top:8px; }
.warning { max-width:1328px; margin:12px auto 0; padding:16px 20px; background:#f7e8df; border:1px solid #ab7765; border-radius:14px; }
.warning h2 { font-size:1rem; margin:0 0 4px; }
.warning p { margin:0; }
.page-shell { max-width:1440px; margin:0 auto; padding:28px clamp(20px,4vw,56px) 40px; }
.layout { display:grid; grid-template-columns:250px minmax(0,1fr); gap:34px; align-items:start; }
.layout.full { grid-template-columns:minmax(0,1fr); }
.contents { position:sticky; top:20px; background:var(--paper); border:1px solid var(--line); border-radius:18px; padding:20px 18px; box-shadow:0 12px 28px #30291a10; }
.contents h2 { margin:0 0 12px; color:var(--gold); font-size:.9rem; letter-spacing:.1em; }
.contents a { display:block; margin:0; padding:6px 2px; font-size:.87rem; text-decoration:none; }
.contents .divider { margin-top:15px; padding-top:12px; border-top:1px solid var(--line); }
main { min-width:0; }
.panel { border:1px solid var(--line); border-radius:18px; background:var(--paper); margin-bottom:22px; padding:22px 24px; box-shadow:0 8px 22px #30291a0d; }
.panel h2 { margin:0 0 12px; font-family:YuMincho,'Yu Mincho',serif; color:var(--navy); font-size:1.42rem; }
.panel p:last-child { margin-bottom:0; }
.progress-panel { background:linear-gradient(110deg,#fffef9,#f7f0df); }
.progress-head { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.progress-head h2 { font-family:inherit; font-size:1rem; }
.progress-number { color:#916000; font-size:1.4rem; font-weight:700; font-variant-numeric:tabular-nums; white-space:nowrap; }
.progress-bar { height:10px; margin:14px 0; background:#e7dfcf; border:1px solid #a99b83; border-radius:10px; overflow:hidden; }
.progress-fill { height:100%; width:0; background:var(--green); transition:width .45s; }
.progress-foot { display:flex; justify-content:space-between; align-items:center; gap:14px; }
.progress-foot p { font-size:.88rem; margin:0; }
.save-status { margin:12px 0 0; padding:10px 14px; border:1px solid #ad715c; border-radius:8px; background:#fff0dc; }
.search-panel { padding:16px 20px; }
.search-label { display:block; font-weight:700; margin-bottom:7px; }
.search-line { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.search-line input { flex:1 1 240px; min-width:0; padding:9px 12px; border:1px solid #8494ab; border-radius:6px; background:white; color:var(--ink); }
.search-results { margin-top:12px; }
.search-results ul { margin:8px 0 0; padding:0; list-style:none; }
.search-results li { padding:10px 0; border-top:1px solid #dfd7c8; }
.result-category { color:#745019; font-size:.8rem; margin-right:9px; }
.context { margin:3px 0 0; font-size:.87rem; color:#42516a; }
.bulk { display:flex; flex-wrap:wrap; gap:8px; margin:22px 0 14px; }
.chapter { margin-bottom:22px; border:1px solid var(--line); border-radius:18px; overflow:hidden; background:#ebe3d3; }
.chapter summary { cursor:pointer; padding:20px 24px; background:var(--paper); color:var(--navy); font:700 1.2rem/1.6 YuMincho,'Yu Mincho',serif; }
.chapter-body { padding:18px 20px 4px; }
.route-card { position:relative; border:1px solid #c5b99f; border-radius:15px; padding:20px 20px 18px 62px; margin:0 0 14px; background:var(--paper); box-shadow:0 5px 12px #30291a0b; scroll-margin-top:20px; }
.route-card h3 { margin:0 0 10px; font-size:1rem; line-height:1.6; }
.route-card input[type=checkbox] { position:absolute; left:22px; top:23px; width:24px; height:24px; margin:0; accent-color:var(--green); cursor:pointer; }
.route-card ol { margin:0; padding-left:22px; }
.route-card li { margin:0 0 8px; padding-left:2px; }
.route-card.checked { opacity:1; padding-bottom:60px; border-color:var(--green); box-shadow:0 6px 16px #23785816; }
.stamp { display:none; position:absolute; right:15px; bottom:12px; width:62px; height:31px; border:2px solid var(--red); border-radius:4px 6px 5px 3px; background:radial-gradient(circle at 16% 28%,#fffdf8eb 0 1px,transparent 1.35px) 0 0/9px 8px,#fffdf8; color:var(--red); font-size:.92rem; font-weight:900; letter-spacing:.1em; text-align:center; line-height:27px; transform:none; }
.checked > .stamp { display:block; }
.route-card.bump { animation:card-bump .58s; }
.route-card.bump > .stamp { animation:stamp-pop .58s; }
@keyframes card-bump { 0%,100%{transform:scale(1)} 36%{transform:scale(1.012)} 68%{transform:scale(.996)} }
@keyframes stamp-pop { 0%{opacity:0;transform:scale(1.4)} 60%{opacity:1;transform:scale(.93)} 100%{opacity:1;transform:scale(1)} }
.note { margin-top:13px; padding:11px 13px; background:#f3ead7; border:1px solid #c6b99c; border-radius:8px; font-size:.91rem; }
.references { display:flex; flex-wrap:wrap; gap:7px; margin-top:12px; }
.references a { border:1px solid #879cb8; border-radius:5px; padding:3px 9px; font-size:.83rem; text-decoration:none; }
.table-wrap { overflow-x:auto; border:1px solid #a8b4c4; border-radius:10px; }
table { border-collapse:collapse; width:100%; min-width:790px; font-size:.91rem; }
th { color:white; background:#223f66; text-align:left; font-weight:800; }
th,td { padding:12px 13px; border-right:1px solid #cfdae5; border-bottom:1px solid #cfdae5; vertical-align:top; }
th:first-child,td:first-child { min-width:140px; }
tr:last-child td { border-bottom:0; }
th:last-child,td:last-child { border-right:0; }
tbody tr:nth-child(even) { background:#f0f3f7; }
tbody tr:target { background:#fff0c8; }
td p { margin:0 0 8px; }
.small-check { width:20px; height:20px; flex:0 0 20px; accent-color:var(--green); vertical-align:middle; }
.check-label { display:flex; gap:8px; align-items:flex-start; }
.tiny { font-size:.83rem; color:#45536a; }
.system-card { scroll-margin-top:20px; }
footer { border-top:1px solid var(--line); padding:24px 20px 32px; text-align:center; background:#eae4d8; }
.back-top { position:fixed; z-index:30; right:max(18px,env(safe-area-inset-right)); bottom:max(18px,env(safe-area-inset-bottom)); width:46px; height:46px; min-height:46px; border:1px solid #7e8998; border-radius:50%; padding:0; background:#fffdf8; color:var(--navy); font-weight:900; box-shadow:0 8px 22px #09182c38; }
.back-top:focus-visible { outline:3px solid #b87925; }
[hidden] { display:none!important; }
@media(max-width:760px) {
 .hero-inner { padding:25px 20px; }
 h1 { font-size:clamp(1.55rem,7vw,2.15rem); }
 html[lang=en] h1 { font-size:clamp(1.6rem,7.4vw,2.2rem); }
 .nav-inner { padding:9px 20px; gap:20px; }
 .category-nav a { font-size:.85rem; }
 .toolbar { align-items:flex-start; padding:12px 20px; }
 .warning { margin:10px 14px 0; padding:14px 16px; }
 .page-shell { padding:20px 42px 64px 14px; }
 .layout { grid-template-columns:1fr; gap:20px; }
 .contents { position:static; padding:16px 24px 16px 20px; }
 .contents a { padding:5px 0; }
 .panel { padding:18px 24px 18px 18px; }
 .progress-head { align-items:flex-start; flex-wrap:wrap; }
 .progress-number { font-size:1.2rem; }
 .progress-foot { align-items:flex-start; flex-direction:column; }
 .chapter summary { padding:17px 18px; font-size:1.1rem; }
 .chapter-body { padding:12px 10px 0; }
 .route-card { padding:54px 14px 16px; }
 .route-card.checked { padding-bottom:60px; }
 .route-card input[type=checkbox] { top:17px; left:15px; }
 .route-card ol { padding-left:21px; }
 .route-card li { margin-bottom:9px; }
 th,td { padding:11px 12px; }
 .search-line input { flex-basis:100%; }
}
@media(prefers-reduced-motion:reduce) {
 html { scroll-behavior:auto; }
 *,*::before,*::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; }
}
@media print {
 body { background:white; font-size:10pt; }
 .language-bar,.category-nav,.toolbar,.warning,.contents,.search-panel,.bulk,.back-top,.progress-panel,footer { display:none!important; }
 .hero { background:white; color:black; }
 .hero-inner { padding:0 0 18px; }
 h1,html[lang=en] h1 { font-size:22pt; }
 .edition { color:black; }
 .page-shell { padding:0; }
 .layout { display:block; }
 .chapter,.panel { box-shadow:none; }
 .route-card { break-inside:avoid; box-shadow:none; }
 .table-wrap { overflow:visible; }
 table { min-width:0; font-size:8pt; }
 th { color:black; background:#eee; }
 .table-wrap { border-color:#aaa; }
}
