:root {
  --ink: #202b36;
  --muted: #58636d;
  --navy: #182b43;
  --navy-2: #233a55;
  --rust: #98533e;
  --gold: #c29a59;
  --paper: #f4efe5;
  --paper-deep: #e9dfce;
  --card: #fffdf8;
  --line: #cfc4b2;
  --green: #315e4a;
  --green-wash: #e8f0e9;
  --shadow: 0 10px 26px rgba(36, 42, 47, .08);
  --serif: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", Georgia, serif;
  --sans: "Yu Gothic", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 1.25rem; background: var(--paper); }
body { margin: 0; color: var(--ink); background: radial-gradient(ellipse at 12% 4%, rgba(193, 154, 89, .10), transparent 30rem), var(--paper); font: 16px/1.78 var(--sans); }
a { color: #23486a; text-decoration-thickness: .08em; text-underline-offset: .17em; }
a:hover { color: #873e2d; }
a:focus-visible, button:focus-visible, input:focus-visible, .table-wrap:focus-visible { outline: 3px solid #c58f37; outline-offset: 3px; }
button, input { font: inherit; }
.skip-link { position: absolute; top: -5rem; left: 1rem; z-index: 20; padding: .6rem .9rem; color: white; background: var(--navy); border: 1px solid white; }
.skip-link:focus { top: 1rem; }
.site-head { color: #fff; background: var(--navy); }
.head-inner { width: min(1160px, calc(100% - 2rem)); min-height: 54px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.back-link { color: inherit; font-weight: 650; text-decoration: none; }
.back-link:hover { color: #f3d89f; }
.language-toggle { min-width: 88px; padding: .35rem .7rem; color: #fff; background: transparent; border: 1px solid #9baab9; border-radius: 999px; cursor: pointer; }
.language-toggle:hover { background: rgba(255,255,255,.1); }
.hero { color: #fff; background: linear-gradient(130deg, #17283d, #233a55 70%, #38434c); border-bottom: 4px solid var(--gold); }
.hero-inner { width: min(1160px, calc(100% - 2rem)); margin: auto; padding: clamp(2.2rem, 6vw, 5rem) 0 3.1rem; }
.edition { display: flex; align-items: center; gap: .75rem; margin: 0 0 1rem; color: #e5d2ac; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; }
.edition-year { padding: .1rem .45rem; color: #fff; border: 1px solid #a99368; border-radius: 999px; letter-spacing: .04em; }
.hero h1 { max-width: 900px; margin: 0; font: 600 clamp(2.3rem, 6.4vw, 4.8rem)/1.28 var(--serif); letter-spacing: .04em; }
.title-en { margin: .55rem 0 1.2rem; color: #d9c8a8; font: 1rem/1.5 Georgia, serif; letter-spacing: .08em; }
.hero-inner > p:last-child { max-width: 720px; margin: .5rem 0 0; color: #f0eee9; }
.chapter-nav { position: relative; z-index: 3; color: #fff; background: var(--navy-2); border-bottom: 1px solid #506176; }
.nav-inner { width: min(1160px, calc(100% - 2rem)); min-height: 54px; margin: auto; display: flex; align-items: stretch; gap: .2rem; overflow-x: auto; scrollbar-width: thin; }
.nav-inner a { display: flex; align-items: center; flex: 0 0 auto; padding: .65rem .85rem; color: #f5f1e9; text-decoration: none; border-bottom: 2px solid transparent; }
.nav-inner a:hover, .nav-inner a:focus-visible { color: #fff; background: rgba(255,255,255,.08); border-bottom-color: var(--gold); }
.page-wrap { width: min(1160px, calc(100% - 2rem)); margin: 1.8rem auto 0; }
.alert-card, .toc-card, .info-card, .route-step, .progress-panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.alert-card { margin-bottom: 1.2rem; padding: 1.25rem clamp(1rem, 3vw, 1.8rem); background: #fbf4e7; border-color: #c8a96f; }
.alert-card h2, .toc-card h2 { margin: 0 0 .65rem; font: 650 1.25rem/1.5 var(--serif); color: #5c3e2c; }
.alert-card ul { margin: 0; padding-left: 1.35rem; }
.alert-card li + li { margin-top: .45rem; }
.alert-card strong { color: #6b3729; }
.toc-card { margin-bottom: 3.2rem; padding: 1.25rem clamp(1rem, 3vw, 1.8rem); }
.toc-card h2 { color: var(--navy); }
.toc-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem 1.6rem; margin: 0; padding-left: 1.4rem; }
.toc-list a { display: inline-block; padding: .18rem 0; }
.search-card { margin: 0 0 3.2rem; padding: 1.2rem clamp(1rem, 3vw, 1.8rem); background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.search-card h2 { margin: 0; color: var(--navy); font: 650 1.25rem/1.5 var(--serif); }
.search-card > p { margin: .3rem 0 .7rem; color: var(--muted); }
#guide-search-form { display: flex; gap: .5rem; }
#guide-search { min-width: 0; flex: 1; padding: .65rem .75rem; color: var(--ink); background: #fff; border: 1px solid #aaa18f; border-radius: 8px; }
.search-button { padding: .55rem 1rem; color: #fff; background: var(--navy-2); border: 1px solid var(--navy-2); border-radius: 8px; cursor: pointer; }
.search-button:hover { background: #314d6b; }
.search-status { min-height: 1.5em; margin: .6rem 0 0 !important; color: var(--muted); font-size: .9rem; }
.search-results { display: grid; gap: .5rem; margin: .4rem 0 0; padding: 0; list-style: none; }
.search-result { padding: .65rem .75rem; background: #f7f3eb; border: 1px solid #d8d0c3; border-radius: 8px; }
.search-result a { font-weight: 700; }
.search-result p { margin: .12rem 0 0; color: var(--muted); font-size: .9rem; }
.search-kind { display: inline-block; margin-right: .35rem; padding: .08rem .4rem; color: #5d432e; background: #eee3cf; border: 1px solid #d6c4a6; border-radius: 999px; font-size: .75rem; font-weight: 650; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.guide-section { margin: 0 0 4rem; scroll-margin-top: 1rem; }
.section-head { margin: 0 0 1.4rem; }
.section-kicker { margin: 0 0 .35rem; color: var(--rust); font-size: .73rem; font-weight: 750; letter-spacing: .18em; }
.section-head h2, .section-head h3 { margin: 0; color: var(--navy); font: 650 clamp(1.65rem, 3.6vw, 2.25rem)/1.35 var(--serif); }
.section-head h3 { font-size: clamp(1.3rem, 2.8vw, 1.75rem); }
.route-subhead { margin-top: 2.1rem; margin-bottom: 1rem; }
.section-head > p:not(.section-kicker) { max-width: 780px; margin: .55rem 0 0; color: var(--muted); }
.intro-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.info-card { padding: 1.1rem 1.25rem; }
.info-card h3 { margin: 0 0 .5rem; color: var(--navy); font: 650 1.13rem/1.45 var(--serif); }
.info-card p { margin: .4rem 0 0; }
.progress-panel { margin: 0 0 1rem; padding: 1rem 1.2rem; }
.progress-copy { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.progress-copy strong { color: var(--navy); }
.progress-track { height: 10px; margin: .65rem 0; overflow: hidden; background: #e3ddd1; border: 1px solid #c6bcad; border-radius: 999px; }
.progress-track > span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #426d58, #88a26d); transition: width .3s ease; }
.progress-actions { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.sound-choice { display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; }
.sound-choice input, .step-check input { width: 1.15rem; height: 1.15rem; accent-color: var(--green); }
.quiet-button { padding: .35rem .7rem; color: var(--navy); background: #f5f1e9; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.quiet-button:hover { background: #ece3d5; }
.storage-warning { margin: .65rem 0 0; padding: .55rem .7rem; color: #5d4029; background: #fbf2dc; border: 1px solid #cfb77f; border-radius: 8px; }
.route-list { display: grid; gap: .85rem; margin: 0; padding: 0; list-style: none; }
.route-step { position: relative; padding: 1rem 1.15rem 1.1rem; scroll-margin-top: .8rem; }
.step-top { min-height: 2.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.step-number { color: var(--rust); font: 700 .85rem/1 var(--sans); letter-spacing: .14em; }
.step-check { display: inline-flex; align-items: center; gap: .4rem; min-width: 96px; justify-content: flex-end; padding: .24rem .5rem; color: #51605f; font-size: .82rem; border: 1px solid transparent; border-radius: 999px; cursor: pointer; }
.step-check span[lang="ja"] { font-weight: 600; }
.route-step h3 { margin: .25rem 0 .5rem; color: var(--navy); font: 650 1.12rem/1.5 var(--serif); }
.route-step p { margin: .35rem 0 0; }
.route-step p.step-related { color: var(--muted); font-size: .9rem; }
.step-related a { margin-left: .25rem; }
.route-step.is-done .step-check { color: var(--green); background: var(--green-wash); border-color: #9bb09f; }
.route-step.is-done .step-check span::before { content: "✓ "; }
.table-wrap { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
table { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 0; }
th, td { padding: .75rem .8rem; text-align: left; vertical-align: top; border-right: 1px solid #d8d0c3; border-bottom: 1px solid #d8d0c3; }
th:last-child, td:last-child { border-right: 0; }
tbody tr:last-child td { border-bottom: 0; }
thead th { color: #fff; background: var(--navy-2); font-size: .88rem; font-weight: 650; }
tbody tr:nth-child(even) { background: #f7f3eb; }
tbody tr:hover { background: #f0e7d8; }
td strong { color: var(--navy); }
td p { margin: 0; }
td p + p { margin-top: .3rem; color: var(--muted); }
.data-link { display: inline-block; margin-top: .32rem; font-size: .82rem; }
.site-foot { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 4rem; padding: 1.2rem 0 2rem; color: var(--muted); border-top: 1px solid var(--line); }
.site-foot .back-link { color: var(--navy); }
.ending-card { border-color: #b99b6b; }
.top-button { position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 10; display: grid; width: 46px; height: 46px; place-items: center; color: #fff; background: var(--navy); border: 1px solid #71839a; border-radius: 50%; box-shadow: 0 4px 12px rgba(20,30,40,.2); cursor: pointer; opacity: 1; pointer-events: auto; }
.noscript { width: min(1160px, calc(100% - 2rem)); margin: 1rem auto; padding: 1rem; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.motion-in { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .motion-in { animation: settle-in .48s ease-out both; }
  @keyframes settle-in { from { opacity: .72; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
html[lang="ja"] [lang="en"], html[lang="en"] [lang="ja"] { display: none !important; }
@media (max-width: 700px) {
  body { font-size: 15px; line-height: 1.75; }
  .head-inner, .hero-inner, .nav-inner, .page-wrap { width: min(100% - 1.1rem, 1160px); }
  .hero-inner { padding-top: 2.1rem; padding-bottom: 2.2rem; }
  .nav-inner { min-height: 48px; }
  .nav-inner a { padding: .55rem .65rem; font-size: .9rem; }
  .page-wrap { margin-top: 1rem; }
  .toc-list, .intro-grid { grid-template-columns: 1fr; }
  #guide-search-form { flex-wrap: wrap; }
  #guide-search { flex-basis: 100%; }
  .guide-section { margin-bottom: 3rem; }
  .route-step { padding: .9rem .85rem 1rem; }
  .step-check { min-width: 92px; }
  th, td { padding: .62rem .65rem; }
  .site-foot { align-items: flex-start; flex-direction: column; }
}
@media print {
  body { color: #111; background: #fff; font-size: 10.5pt; }
  .site-head, .chapter-nav, .language-toggle, .progress-actions, .progress-track, .top-button, .skip-link { display: none !important; }
  .hero { color: #111; background: #fff; border-bottom: 1px solid #444; }
  .hero-inner { padding: 1rem 0; }
  .hero h1, .title-en, .edition, .hero-inner > p:last-child { color: #111; }
  .page-wrap { width: 100%; margin: 1rem auto; }
  .alert-card, .toc-card, .info-card, .route-step, .progress-panel, .table-wrap { box-shadow: none; break-inside: avoid; }
  .guide-section { break-before: auto; }
  .table-wrap { overflow: visible; }
  table { min-width: 0; font-size: 8.5pt; }
  th, td { padding: .35rem; }
  .route-step.is-done .step-check { color: #111; background: #fff; }
  a { color: #111; text-decoration: none; }
}
