:root {
  color-scheme: light;
  --navy: #17375f;
  --navy-light: #1d3f6b;
  --paper: #f2efe7;
  --panel: #fffef9;
  --ink: #182334;
  --muted: #46536a;
  --blue: #075b9a;
  --gold: #a76800;
  --green: #237858;
  --red: #b3332f;
  --line: #c4b69f;
  --shadow: 0 9px 24px rgb(50 40 23 / 9%);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 16px/1.78 "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); text-underline-offset: .24em; }
a:hover { color: #003c6e; }
button { cursor: pointer; }
button, input { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid #b57719;
  outline-offset: 3px;
}
.skip { position: absolute; top: -80px; left: 16px; z-index: 20; padding: 8px 16px; background: white; }
.skip:focus { top: 8px; }
.language-bar {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 7px max(24px, calc((100vw - 1440px) / 2 + 56px));
  padding-right: max(112px, calc((100vw - 1440px) / 2 + 112px));
  background: #eee8dc;
  border-bottom: 1px solid var(--line);
}
.language-bar > a { font-size: .84rem; font-weight: 700; }
.language-buttons { display: flex; gap: 8px; }
.language-buttons button { padding: 5px 15px; border: 1px solid #7e8998; border-radius: 99px; background: var(--panel); font-size: .8rem; min-height: 35px; }
.language-buttons button[aria-pressed="true"] { color: white; border-color: var(--navy); background: var(--navy); }
.hero { color: white; background: linear-gradient(118deg, var(--navy), var(--navy-light)); }
.hero-inner { max-width: 1440px; margin: auto; padding: 42px 56px 34px; }
.edition { margin: 0 0 9px; font-weight: 700; font-size: .85rem; letter-spacing: .04em; }
h1 { margin: 0; font: 700 clamp(2rem, 4.1vw, 3.45rem)/1.26 YuMincho, "Yu Mincho", serif; text-wrap: balance; letter-spacing: .015em; }
html[lang="en"] h1 { font-size: clamp(1.8rem, 3.7vw, 3.25rem); }
.category-nav { background: var(--panel); border-bottom: 1px solid #aeb8c7; box-shadow: 0 3px 12px rgb(20 35 60 / 7%); overflow: auto; }
.category-inner { display: flex; gap: 8px 25px; width: max-content; min-width: min(100%, 1440px); margin: auto; padding: 10px 56px; }
.category-inner a { display: inline-flex; align-items: center; min-height: 32px; color: var(--blue); white-space: nowrap; border-bottom: 2px solid transparent; font-weight: 800; text-decoration: none; }
.category-inner a[aria-current="page"] { border-color: var(--gold); color: var(--navy); }
.category-inner a:hover { border-color: var(--gold); }
.toolbar { max-width: 1440px; margin: auto; display: flex; justify-content: flex-end; gap: 10px; padding: 12px 56px; flex-wrap: wrap; }
.button { border: 1px solid #a18f72; background: var(--panel); border-radius: 9px; padding: 8px 14px; min-height: 42px; font-size: .89rem; font-weight: 700; }
.button:hover { border-color: var(--navy); }
.button[aria-pressed="true"] { color: #155a42; border-color: var(--green); background: #e6f4ed; }
.page-body { max-width: 1440px; margin: auto; padding: 16px 56px 60px; }
.early-notice { margin-bottom: 22px; border: 1px solid #bc8a6e; border-radius: 12px; background: #f7e9df; padding: 16px 21px; }
.early-notice h2 { font-size: 1rem; color: #763d29; margin: 0 0 6px; }
.early-notice ul { padding-left: 22px; margin: 0; }
.early-notice li + li { margin-top: 5px; }
.search-panel { padding: 17px 20px; background: #f8f5ee; border: 1px solid #b6bdc9; border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 26px; }
.search-form { display: flex; align-items: end; gap: 10px; }
.search-field { flex: 1; min-width: 0; }
.search-field label { display: block; color: var(--navy); font-size: .86rem; font-weight: 800; margin-bottom: 5px; }
.search-field input { width: 100%; padding: 9px 12px; min-height: 44px; border: 1px solid #8291a6; border-radius: 7px; background: white; }
.search-status { margin: 8px 0 0; color: var(--muted); font-size: .85rem; }
.search-results { margin: 14px 0 0; padding-left: 22px; }
.search-results li { padding: 8px 2px; }
.search-results small { display: block; color: var(--muted); }
.search-results p { margin: 2px 0; font-size: .9rem; }
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 34px; align-items: start; }
.toc { position: sticky; top: 20px; padding: 17px; background: var(--panel); border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow); max-height: calc(100vh - 40px); overflow: auto; }
.toc > summary { font-size: .84rem; color: var(--gold); font-weight: 800; letter-spacing: .08em; cursor: pointer; }
.toc a { display: block; padding: 7px 3px; font-size: .86rem; text-decoration: none; line-height: 1.5; }
.toc a:first-of-type { margin-top: 11px; }
.toc a:hover { background: #f2eadb; }
main { min-width: 0; }
.section-heading { margin: 0 0 14px; color: var(--navy); font-size: 1.45rem; }
.progress-card { padding: 21px 24px; margin-bottom: 22px; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(135deg, #fffefa, #f7f1e5); box-shadow: var(--shadow); }
.progress-head { display: flex; justify-content: space-between; align-items: center; gap: 15px; flex-wrap: wrap; }
.progress-head h2 { margin: 0; font-size: 1rem; color: var(--navy); }
.progress-number { color: #875b06; font-size: 1.28rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.progress-card p { font-size: .86rem; color: var(--muted); margin: 8px 0 11px; }
.progress-track { height: 11px; background: #e9e2d6; border: 1px solid #aa9a81; border-radius: 99px; overflow: hidden; }
.progress-fill { width: 0; height: 100%; background: linear-gradient(90deg, var(--green), #d29b2e); transition: width .24s ease; }
.progress-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.save-status { min-height: 1.78em; }
.save-status[data-failed="true"] { color: #9b2e23; font-weight: 700; }
.floating-progress { position: fixed; right: 16px; top: 10px; z-index: 10; display: grid; place-items: center; width: 72px; height: 72px; border: 3px solid var(--navy-light); border-radius: 50%; background: #fffdf8; color: #194a3c; font-weight: 900; box-shadow: 0 5px 18px rgb(9 24 44 / 20%); pointer-events: none; }
.floating-progress::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; border: 1px solid #c1cbd5; }
.chart-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 19px; }
.chapter, .data-section { margin-bottom: 23px; border: 1px solid var(--line); background: #eae3d4; border-radius: 17px; overflow: hidden; }
.chapter > summary { padding: 20px 22px; background: var(--panel); color: var(--navy); font-size: 1.17rem; font-weight: 800; cursor: pointer; }
.chapter-content { padding: 19px; }
.route-card { position: relative; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 5px 15px rgb(50 40 23 / 6%); padding: 20px 21px; margin-bottom: 14px; }
.route-card:last-child { margin-bottom: 0; }
.route-heading { display: flex; align-items: flex-start; gap: 13px; }
.route-heading input { flex: 0 0 24px; width: 24px; height: 24px; margin: 4px 0 0; accent-color: var(--green); cursor: pointer; }
.route-heading label { flex: 1; cursor: pointer; font-weight: 800; font-size: 1rem; }
.route-card ol { padding-left: 25px; margin: 12px 0 0 37px; }
.route-card li + li { margin-top: 6px; }
.route-card p { margin: 12px 0 0 37px; }
.route-card .warning { padding: 10px 13px; background: #f3ead7; border: 1px solid #c8b99b; border-radius: 8px; font-size: .9rem; }
.related-links { display: flex; flex-wrap: wrap; gap: 7px 15px; margin: 11px 0 0 37px; font-size: .88rem; }
.route-card.is-complete { border-color: var(--green); padding-bottom: 61px; }
.stamp { display: none; }
.is-complete > .stamp { position: absolute; right: 15px; bottom: 12px; display: grid; place-items: center; width: 62px; height: 31px; border: 2px solid var(--red); border-radius: 4px 6px 5px 3px; color: var(--red); background: radial-gradient(circle at 16% 28%, #fffdf8 0 1px, transparent 1.35px) 0 0 / 9px 8px, #fffdf8e8; font-weight: 900; font-size: .9rem; letter-spacing: .08em; line-height: 1; transform: none; text-shadow: .4px 0 #78201966; }
.route-card.is-bumping { animation: card-bump .58s ease; }
.is-bumping > .stamp { animation: stamp-pop .58s ease; }
.floating-progress.is-bumping { animation: progress-bump .64s ease; }
@keyframes card-bump { 0%, 100% { transform: scale(1); } 38% { transform: scale(1.013); } 70% { transform: scale(.996); } }
@keyframes stamp-pop { 0% { opacity: 0; transform: scale(1.4); } 60% { opacity: 1; transform: scale(.94); } 100% { opacity: 1; transform: none; } }
@keyframes progress-bump { 0%,100% { transform: scale(1); } 34% { transform: scale(1.18); } 64% { transform: scale(.94); } }
.data-section { background: var(--panel); padding: 21px; }
.data-section h2 { color: var(--navy); font-size: 1.25rem; margin: 0 0 13px; }
.data-section p { margin: 9px 0 15px; }
.table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid #acb6c5; border-radius: 9px; background: white; }
table { width: 100%; border-collapse: collapse; font-size: .91rem; line-height: 1.65; min-width: 660px; }
thead th { color: white; background: #233e65; text-align: left; white-space: nowrap; }
tbody th { text-align: left; font-weight: 700; }
th, td { padding: 10px 12px; border: 1px solid #cbd3de; vertical-align: top; }
th:first-child, td:first-child { min-width: 125px; }
td { min-width: 110px; }
tbody tr:nth-child(even) { background: #eff3f6; }
tbody tr:target { outline: 3px solid var(--gold); outline-offset: -3px; }
.data-links { margin-top: 15px; }
.back-top { position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 15; width: 46px; height: 46px; display: grid; place-items: center; padding: 0; border: 1px solid #7e8998; border-radius: 50%; color: var(--navy); background: #fffdf8; box-shadow: 0 7px 20px rgb(9 24 44 / 20%); font: 900 1.15rem/1 "Yu Gothic UI", sans-serif; }
footer { max-width: 1440px; margin: auto; padding: 0 56px 82px; text-align: center; }
footer a { font-weight: 700; }
[hidden] { display: none !important; }
@media (max-width: 950px) {
  .hero-inner { padding: 32px 26px; }
  .category-inner { padding: 9px 26px; gap: 8px 20px; }
  .page-body { padding-left: 24px; padding-right: 24px; }
  .layout { grid-template-columns: 210px minmax(0, 1fr); gap: 23px; }
}
@media (max-width: 760px) {
  .language-bar { padding: 8px 82px 8px 18px; }
  .language-bar > a { width: 100%; }
  .floating-progress { width: 58px; height: 58px; top: 10px; right: 10px; font-size: .9rem; border-width: 2px; }
  .hero-inner { padding: 28px 20px 26px; }
  h1 { font-size: clamp(1.55rem, 7vw, 2.15rem); text-wrap: wrap; }
  html[lang="en"] h1 { font-size: clamp(1.55rem, 7.3vw, 2.15rem); }
  .edition { font-size: .78rem; }
  .category-inner { min-width: 100%; padding: 8px 20px; gap: 8px 20px; }
  .category-inner a { font-size: .88rem; }
  .toolbar { padding: 12px 18px; }
  .page-body { padding: 10px 18px 40px; }
  .layout { display: block; }
  .toc { position: static; max-height: none; margin-bottom: 22px; border-radius: 12px; }
  .toc a { font-size: .88rem; }
  .early-notice { padding: 14px 16px; }
  .search-panel { padding: 14px; }
  .search-form { flex-wrap: wrap; }
  .search-field { flex-basis: 100%; }
  .search-form .button { min-height: 38px; padding: 5px 12px; }
  .progress-card { padding: 17px; }
  .progress-head { gap: 7px; }
  .progress-number { font-size: 1.14rem; }
  .chapter > summary { padding: 16px; font-size: 1.1rem; }
  .chapter-content { padding: 10px; }
  .route-card { padding: 16px 15px; }
  .route-heading { gap: 10px; }
  .route-heading label { font-size: 1rem; }
  .route-card ol { margin-left: 0; padding-left: 23px; }
  .route-card p, .related-links { margin-left: 0; }
  .data-section { padding: 16px; }
  footer { padding: 0 72px 85px 18px; }
}
@media (max-width: 480px) {
  .page-body { padding-right: 72px; padding-left: 14px; }
  .toolbar { padding-right: 72px; padding-left: 14px; }
  .back-top { right: 14px; width: 44px; height: 44px; }
  .route-heading { flex-wrap: wrap; }
  .route-heading label { flex-basis: calc(100% - 36px); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .language-bar, .category-nav, .toolbar, .toc, .search-panel, .chart-actions,
  .progress-actions, .back-top, .floating-progress, footer, .skip { display: none !important; }
  body, .hero, .chapter, .data-section, .route-card { color: black; background: white; box-shadow: none; }
  .hero-inner { padding: 15px 0; }
  h1, html[lang="en"] h1 { font-size: 26px; color: black; }
  .page-body { padding: 0; }
  .layout { display: block; }
  .chapter { break-inside: auto; }
  .route-card { break-inside: avoid; }
  .chapter-content { padding: 9px; }
  .table-wrap { overflow: visible; }
  table { min-width: 0; font-size: 9px; }
  th, td { min-width: 0 !important; padding: 4px; }
  th { color: black; background: #eee; }
}
