:root {
  color-scheme: light;
  --navy: #17375f;
  --navy-light: #1d3f6b;
  --paper: #fffef9;
  --ink: #182438;
  --link: #075b9a;
  --gold: #a76800;
  --green: #237858;
  --red: #b3332f;
  --line: #b9ad99;
  --muted: #4b5868;
  font-family: "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.78;
  scroll-behavior: smooth;
}
* { box-sizing: border-box; }
body { margin: 0; background: #f2efe7; color: var(--ink); }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
a { color: var(--link); text-underline-offset: .2em; }
a:hover { color: var(--navy); }
button { cursor: pointer; }
button, .button-link {
  min-height: 44px;
  padding: 8px 15px;
  border: 1px solid #8e806c;
  border-radius: 9px;
  background: var(--paper);
  color: var(--navy);
  font-weight: 700;
}
button:hover { background: #f2eadb; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #ad7728;
  outline-offset: 3px;
}
[hidden] { display: none !important; }
.skip { position: absolute; top: -100px; left: 16px; z-index: 1000; padding: 10px; background: white; }
.skip:focus { top: 5px; }
.utility {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 7px max(20px, calc((100vw - 1440px) / 2 + 32px));
  padding-right: max(110px, calc((100vw - 1440px) / 2 + 110px));
  background: #eee8dc;
  border-bottom: 1px solid #b9ad99;
}
.utility a { font-size: .88rem; font-weight: 700; }
.languages { display: flex; gap: 8px; flex: 0 0 auto; }
.languages button { border-radius: 999px; padding: 4px 13px; min-height: 36px; font-size: .78rem; }
.languages [aria-pressed="true"] { background: var(--navy); color: white; border-color: var(--navy); }
.hero { color: white; background: linear-gradient(118deg, #17375f, #1d3f6b); }
.hero-inner { max-width: 1480px; margin: auto; padding: 44px clamp(24px, 5.2vw, 80px) 34px; }
h1 {
  margin: 0;
  font-family: YuMincho, "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(2rem, 4.1vw, 3.45rem);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: .015em;
  overflow-wrap: anywhere;
}
.edition { display: block; margin-top: 12px; font-family: "Yu Gothic UI", Meiryo, sans-serif; font-size: .88rem; font-weight: 500; letter-spacing: .02em; }
html[lang="en"] h1 { font-size: clamp(1.8rem, 3.7vw, 3.25rem); }
.category-nav { background: #fffdf8; border-bottom: 1px solid #aeb8c7; box-shadow: 0 3px 12px #14233c12; }
.category-inner { max-width: 1480px; margin: auto; display: flex; flex-wrap: wrap; gap: 6px 26px; padding: 10px clamp(24px, 5.2vw, 80px); }
.category-nav a { display: inline-flex; align-items: center; min-height: 36px; font-size: .92rem; font-weight: 800; border-bottom: 2px solid transparent; text-decoration: none; }
.category-nav [aria-current="page"] { border-bottom-color: var(--gold); color: var(--navy); }
.tools { max-width: 1440px; margin: auto; padding: 15px clamp(20px, 4vw, 56px); display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.tools [aria-pressed="true"] { background: #e6f4ed; border-color: var(--green); color: #155a42; }
.search-shell { max-width: 1440px; margin: auto; padding: 0 clamp(20px, 4vw, 56px) 20px; }
.search-box { padding: 16px 18px; background: #fffdf8; border: 1px solid var(--line); border-radius: 13px; }
.search-box label { display: block; color: var(--navy); font-size: .9rem; font-weight: 750; margin-bottom: 7px; }
.search-controls { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; }
.search-controls input { width: 100%; min-width: 0; min-height: 46px; border: 1px solid #8a9bb1; border-radius: 7px; padding: 9px 12px; background: white; color: var(--ink); }
.search-count { margin: 7px 0 0; color: var(--muted); font-size: .84rem; }
.search-results { margin: 12px 0 0; padding: 0; list-style: none; max-height: 460px; overflow-y: auto; }
.search-results li { border: 1px solid #d8cbb8; border-radius: 8px; margin-top: 9px; padding: 11px 13px; background: #fffef9; }
.search-results a { font-weight: 750; }
.search-results small { display: block; color: var(--muted); }
.search-results p { margin: 5px 0 0; font-size: .9rem; }
.critical-wrap { max-width: 1440px; margin: auto; padding: 0 clamp(20px,4vw,56px) 22px; }
.critical-wrap > h2 { margin: 0 0 12px; color: var(--navy); font-size: 1.12rem; }
.critical-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.critical-card { margin: 0; padding: 16px 18px; border: 1px solid #a9614d; border-radius: 12px; background: #f6e8de; font-size: .91rem; line-height: 1.8; }
.layout { max-width: 1440px; margin: auto; padding: 0 clamp(20px,4vw,56px) 70px; display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 34px; }
.toc { position: sticky; top: 20px; align-self: start; max-height: calc(100vh - 40px); overflow: auto; padding: 18px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 12px 28px #40301a14; }
.toc h2 { margin: 0 0 10px; color: var(--gold); font-size: .87rem; letter-spacing: .08em; }
.toc a { display: block; padding: 7px 9px; min-height: 38px; color: #3f4e62; font-size: .88rem; text-decoration: none; line-height: 1.5; }
.toc a:hover { background: #f3edde; border-radius: 7px; }
.toc .toc-group { margin-top: 12px; padding-top: 12px; border-top: 1px solid #cbbda7; }
main { min-width: 0; }
h2 { color: var(--navy); font-size: 1.4rem; line-height: 1.45; }
h3 { font-size: 1.08rem; line-height: 1.6; }
p { margin: .7em 0; }
.panel { margin: 0 0 22px; padding: 23px 24px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); box-shadow: 0 10px 25px #40301a12; }
.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }
.progress-panel { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 20px; background: linear-gradient(135deg,#fffefa,#f7f1e5); }
.progress-panel h2 { font-size: 1.05rem; margin: 0; }
.progress-panel p { color: var(--muted); font-size: .86rem; }
.progress-number { display: block; font-size: 1.35rem; font-weight: 800; color: #875b06; font-variant-numeric: tabular-nums; text-align: right; }
.progress-actions { display: grid; justify-items: end; gap: 10px; }
.progress-track { height: 12px; overflow: hidden; border: 1px solid #b9a88d; border-radius: 999px; background: #e9e2d6; }
.progress-fill { width: 0; height: 100%; background: linear-gradient(90deg,#237858,#c39636); transition: width .24s ease; }
.save-note { font-size: .86rem; color: var(--muted); }
.save-note.failed { color: #8e3028; font-weight: 700; }
.floating-progress { position: fixed; top: 16px; right: max(14px,calc((100vw - 1480px) / 2 + 18px)); z-index: 100; width: 72px; height: 72px; display: grid; place-items: center; border: 2px solid #1d3f6b; border-radius: 50%; background: #fffdf8f7; color: #194a3c; box-shadow: 0 6px 20px #09182c38, inset 0 0 0 4px white; font-size: 1.06rem; font-weight: 900; line-height: 1; pointer-events: none; }
.floating-progress.bump { animation: progress-bump .64s ease; }
.chart-controls { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.chapter { margin: 0 0 22px; border: 1px solid var(--line); border-radius: 17px; background: #eee6d7; box-shadow: 0 10px 24px #40301a12; overflow: hidden; scroll-margin-top: 22px; }
.chapter > summary { cursor: pointer; padding: 22px 34px 22px 22px; background: var(--paper); color: var(--navy); font-size: 1.18rem; font-weight: 800; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chapter > summary::-webkit-details-marker { display: none; }
.chapter > summary::after { content: '+'; display: grid; flex: 0 0 32px; place-items: center; height: 32px; border: 1px solid #b9ad99; border-radius: 50%; color: var(--gold); font-weight: 500; }
.chapter[open] > summary::after { content: '−'; }
.chapter-body { padding: 20px; }
.conditions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 15px; }
.condition { padding: 12px 14px; border: 1px solid #b9ad99; border-radius: 9px; background: #fffaf0; font-size: .88rem; }
.condition strong { display: block; color: var(--navy); }
.preparation { margin: 0 0 18px; line-height: 1.8; font-size: .95rem; }
.route-card { position: relative; margin: 0 0 13px; padding: 18px 20px 18px 62px; border: 1px solid #c9bba5; border-radius: 15px; background: var(--paper); box-shadow: 0 6px 15px #40301a0d; scroll-margin-top: 30px; }
.route-card:last-child { margin-bottom: 0; }
.route-card label { display: block; font-weight: 800; line-height: 1.6; cursor: pointer; }
.route-card input { position: absolute; left: 21px; top: 23px; width: 23px; height: 23px; margin: 0; accent-color: var(--green); cursor: pointer; }
.route-card p { margin: 10px 0 0; line-height: 1.85; }
.route-card.done { padding-bottom: 60px; border-color: var(--green); opacity: 1; }
.route-card.done::after { position: absolute; right: 15px; bottom: 12px; display: grid; place-items: center; width: 62px; height: 31px; border: 2px solid #b3332feb; border-radius: 4px 6px 5px 3px; background: radial-gradient(circle at 16% 28%,#fffdf8eb 0 1px,transparent 1.35px) 0 0 / 9px 8px,#fffdf8dd; color: var(--red); content: '完了'; font-size: .92rem; font-weight: 900; letter-spacing: .1em; line-height: 1; transform: none; }
html[lang="en"] .route-card.done::after { content: 'DONE'; }
.route-card.bump { animation: card-bump .58s ease; }
.route-card.done.bump::after { animation: stamp-pop .58s ease; }
.reference-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 16px; font-size: .87rem; }
.reference-links a { min-height: 34px; display: inline-flex; align-items: center; }
.table-panel { scroll-margin-top: 25px; }
.table-panel h2 { margin-bottom: 14px; }
.table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid #a5b4c6; border-radius: 10px; scrollbar-width: auto; }
table { width: 100%; min-width: 750px; border-collapse: collapse; font-size: .91rem; line-height: 1.75; }
th { background: #203d66; color: white; text-align: left; padding: 12px; font-weight: 800; border: 1px solid #657a97; }
td { padding: 12px; border: 1px solid #ced6e0; vertical-align: top; overflow-wrap: break-word; min-width: 150px; }
td:first-child { min-width: 150px; font-weight: 700; }
tr:nth-child(even) td { background: #eef2f6; }
tr:nth-child(odd) td { background: #fff; }
tbody tr:target td { background: #fff1c5; }
.table-hint { font-size: .85rem; color: var(--muted); margin: -3px 0 12px; }
.data-links { display: flex; flex-wrap: wrap; gap: 10px 20px; margin: 0 0 20px; }
.data-links a { min-height: 36px; display: inline-flex; align-items: center; }
.back-top { position: fixed; right: max(18px,env(safe-area-inset-right)); bottom: max(18px,env(safe-area-inset-bottom)); z-index: 110; display: grid; place-items: center; width: 46px; height: 46px; min-height: 0; padding: 0; border: 1px solid #7e8998; border-radius: 50%; background: #fffdf8; color: var(--navy); box-shadow: 0 8px 22px #09182c38; font-size: 1.15rem; line-height: 1; }
footer { padding: 24px 80px 36px; text-align: center; background: #e9e2d6; border-top: 1px solid var(--line); }
footer a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 750; }
@keyframes card-bump { 0%,100% { transform: scale(1); } 40% { transform: scale(1.012); } }
@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); } 35% { transform: scale(1.15); } 65% { transform: scale(.95); } }
@media (max-width: 760px) {
  .utility { align-items: flex-start; padding: 8px 80px 8px 18px; flex-wrap: wrap; gap: 5px 15px; }
  .utility a { min-height: 32px; display: inline-flex; align-items: center; }
  .hero-inner { padding: 28px 20px 25px; }
  h1 { font-size: clamp(1.55rem,7vw,2.15rem); }
  html[lang="en"] h1 { font-size: clamp(1.6rem,7.4vw,2.15rem); }
  .edition { font-size: .8rem; line-height: 1.5; margin-top: 9px; }
  .category-inner { gap: 6px 22px; padding: 8px 20px; }
  .category-nav a { font-size: .87rem; }
  .tools { padding: 12px 14px; }
  .search-shell { padding: 0 14px 18px; }
  .search-box { padding: 13px; }
  .critical-wrap { padding: 0 72px 20px 14px; }
  .critical-grid { grid-template-columns: 1fr; gap: 10px; }
  .critical-card { padding: 13px 15px; }
  .layout { padding: 0 72px 65px 14px; grid-template-columns: 1fr; gap: 22px; }
  .toc { position: static; max-height: none; padding: 16px; }
  .toc nav { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
  .toc .toc-group { grid-column: 1 / -1; }
  .toc a { font-size: .86rem; }
  .panel { padding: 19px 18px; }
  .progress-panel { grid-template-columns: 1fr; gap: 13px; }
  .progress-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .progress-number { font-size: 1.15rem; text-align: left; }
  .floating-progress { top: 10px; right: 10px; width: 58px; height: 58px; font-size: .91rem; }
  .chapter > summary { padding: 18px 16px; font-size: 1.08rem; }
  .chapter-body { padding: 12px 10px; }
  .conditions { grid-template-columns: 1fr; gap: 8px; }
  .preparation { padding: 0 4px; font-size: .94rem; }
  .route-card { padding: 16px 14px 17px; }
  .route-card label { padding-left: 36px; min-height: 28px; }
  .route-card input { left: 14px; top: 19px; }
  .route-card p { font-size: .97rem; }
  .reference-links { gap: 6px 12px; padding: 0 4px; }
  .table-panel { padding: 18px 14px; }
  table { min-width: 800px; }
  td,th { padding: 11px 12px; }
  footer { padding: 20px 75px 32px 20px; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  :root { font-size: 11pt; }
  body { background: white; }
  .utility,.category-nav,.tools,.search-shell,.toc,.floating-progress,.back-top,.chart-controls,.progress-actions,.save-note,footer { display: none !important; }
  .hero { background: white; color: black; }
  .hero-inner { padding: 0 0 15px; }
  h1,html[lang="en"] h1 { font-size: 24pt; }
  .critical-wrap,.layout { display: block; max-width: none; padding: 0; }
  .critical-grid { grid-template-columns: 1fr; }
  .critical-card { background: white; }
  .panel,.chapter,.route-card { box-shadow: none; break-inside: avoid; }
  .table-wrap { overflow: visible; }
  table { min-width: 0; font-size: 8pt; }
  td,td:first-child { min-width: 0; }
  a { color: black; }
}
