:root {
  --navy: #17375f;
  --blue: #075b9a;
  --gold: #986300;
  --paper: #fffef9;
  --ink: #15233d;
  --line: #c4b69f;
  --green: #237858;
  --red: #b3332f;
  font-family: "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  color: var(--ink);
  background: #f2efe7;
  font-size: 16px;
  line-height: 1.78;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); text-underline-offset: 3px; }
button { cursor: pointer; }
button, input[type="search"] {
  min-height: 42px;
  border: 1px solid #8f836e;
  border-radius: 9px;
  padding: 7px 13px;
  color: var(--ink);
  background: var(--paper);
}
button:hover { background: #e9edf2; }
:focus-visible { outline: 3px solid #b47719; outline-offset: 3px; }
[hidden] { display: none !important; }
.skip { position: fixed; left: 18px; top: -100px; z-index: 1000; background: var(--paper); padding: 12px; }
.skip:focus { top: 10px; }
.language-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  min-height: 54px;
  padding: 7px max(24px, calc((100vw - 1480px) / 2 + 24px));
  padding-right: 110px;
  background: #eee8dc;
}
.guides-link { font-size: .88rem; font-weight: 700; }
.languages { display: flex; gap: 8px; }
.languages button { min-height: 34px; padding: 4px 14px; border-radius: 999px; font-size: .82rem; font-weight: 800; }
.languages [aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: white; }
.hero { color: white; background: linear-gradient(118deg,#17375f,#1d3f6b); }
.hero-inner { max-width: 1480px; padding: 36px clamp(24px,5.2vw,80px) 30px; margin: auto; }
h1 { font-family: YuMincho,"Yu Mincho",serif; font-size: clamp(2rem,4.1vw,3.45rem); line-height: 1.24; letter-spacing: .015em; margin: 0; text-wrap: balance; }
html[lang="en"] h1 { font-size: clamp(1.8rem,3.7vw,3.25rem); }
#edition { margin: 13px 0 0; font-size: .86rem; color: #e4ebf2; }
.category-nav { background: var(--paper); border-bottom: 1px solid #aeb8c7; box-shadow: 0 3px 12px #14233c12; overflow-x: auto; }
#categories { display: flex; width: max-content; min-width: 100%; gap: 24px; padding: 8px clamp(24px,5.2vw,80px); }
#categories a { display: inline-flex; align-items: center; min-height: 38px; font-size: .92rem; font-weight: 850; text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
#categories a[aria-current="page"] { border-color: var(--gold); color: var(--navy); }
.toolbar { max-width: 1440px; margin: auto; padding: 18px clamp(20px,4vw,56px); display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.search-area { flex: 1; max-width: 850px; }
.search-area label { display: block; font-size: .85rem; font-weight: 700; margin-bottom: 4px; }
.search-input { display: flex; gap: 8px; }
#search { flex: 1; width: 0; min-width: 0; border-color: #879bb3; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; }
#sound[aria-pressed="true"] { background: #e4f0e8; border-color: var(--green); }
.floating-progress { position: fixed; z-index: 20; right: 18px; top: 12px; display: grid; place-items: center; width: 70px; height: 70px; border: 3px solid #1d3f6b; border-radius: 50%; background: #fffef9f5; box-shadow: 0 7px 20px #09182c33; color: var(--green); font-weight: 850; pointer-events: none; }
main { max-width: 1440px; margin: auto; padding: 12px clamp(20px,4vw,56px) 64px; }
.warnings { margin: 0 0 24px; padding: 19px 23px; border: 1px solid #a06d57; border-radius: 15px; background: #f7e9e1; }
.warnings h2 { font-size: 1rem; margin: 0 0 7px; color: #74391f; }
.warnings ul { margin: 0; padding-left: 1.3em; }
.warnings li + li { margin-top: 9px; }
.layout { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 34px; align-items: start; }
.contents { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 10px 28px #40301a12; }
.contents summary { color: var(--gold); font-weight: 800; font-size: .85rem; cursor: pointer; }
.contents a { display: block; padding: 7px 5px; font-size: .87rem; line-height: 1.5; text-decoration: none; color: #374151; }
.contents a:hover { background: #eee8dc; }
.progress-card { padding: 20px 24px; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(135deg,#fffefa,#f7f1e5); margin-bottom: 22px; box-shadow: 0 10px 28px #40301a12; }
.progress-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.progress-card h2 { font-size: 1rem; margin: 0; }
.progress-number { color: var(--gold); font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.progress-card p { margin: 7px 0 10px; font-size: .85rem; color: #46536a; }
.progress-track { height: 12px; overflow: hidden; background: #e8dfd1; border: 1px solid #b7a68b; border-radius: 999px; margin: 12px 0; }
.progress-fill { height: 100%; background: linear-gradient(90deg,#237858,#bc8b30); transition: width .24s; }
.controls { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 24px; }
.chapter { margin-bottom: 24px; border: 1px solid var(--line); border-radius: 17px; background: #e9e1d2; overflow: clip; }
.chapter > summary { cursor: pointer; background: var(--paper); padding: 18px 22px; font-weight: 800; font-size: 1.15rem; line-height: 1.5; }
.chapter-body { padding: 0 18px 18px; }
.route-card { position: relative; margin-top: 14px; padding: 19px 20px 19px 62px; border: 1px solid #c7bba5; border-radius: 14px; background: var(--paper); box-shadow: 0 5px 13px #40301a0d; }
.route-card h3 { margin: 0 0 9px; font-size: 1.05rem; line-height: 1.5; }
.route-card ol { margin: 0; padding-left: 1.3em; }
.route-card li + li { margin-top: 9px; }
.route-card input { position: absolute; left: 19px; top: 23px; width: 24px; height: 24px; margin: 0; accent-color: var(--green); cursor: pointer; }
.route-card.is-complete { padding-bottom: 64px; border-color: var(--green); box-shadow: 0 7px 18px #1857421a; }
.stamp { 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; color: var(--red); background: radial-gradient(circle at 16% 28%,#fffef9eb 0 1px,transparent 1.35px) 0 0/9px 8px,#fffef9dd; font-weight: 900; font-size: .92rem; letter-spacing: .08em; line-height: 1; transform: none; }
.tip { margin: 14px 0 0; padding: 11px 13px; border: 1px solid #b8a887; border-radius: 8px; background: #f3ecd9; font-size: .9rem; }
.tag { display: inline-block; color: #78530d; font-size: .7rem; font-weight: 700; border: 1px solid #b7a077; border-radius: 999px; padding: 1px 8px; margin: 0 0 8px; }
.references { margin: 13px 0 0; display: flex; gap: 9px; flex-wrap: wrap; font-size: .85rem; }
.references a { padding: 3px 9px; border: 1px solid #7c94ae; border-radius: 6px; text-decoration: none; }
.data-view { padding-top: 8px; }
.data-view h2 { font-size: 1.5rem; margin: 8px 0 12px; color: var(--navy); }
.data-view > p { max-width: 76ch; margin: 0 0 22px; }
.table-wrap { border: 1px solid #b2bfd0; border-radius: 13px; overflow: auto; background: var(--paper); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; line-height: 1.65; }
th, td { padding: 12px 13px; border-bottom: 1px solid #c8d2df; vertical-align: top; }
thead th { color: white; background: var(--navy); text-align: left; white-space: nowrap; }
tbody th { text-align: left; min-width: 150px; font-weight: 800; }
td { min-width: 135px; max-width: 340px; }
tbody tr:nth-child(even) { background: #eef2f6; }
tbody tr:last-child > * { border-bottom: 0; }
tr:target, .route-card:target, .note-card:target { outline: 3px solid #d5a34e; outline-offset: -3px; }
.collection-check { display: flex; align-items: flex-start; gap: 8px; }
.collection-check input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--green); flex: 0 0 auto; }
tr.is-collected { background: #e6f0e9 !important; }
.route-ref { display: block; margin-top: 7px; white-space: nowrap; }
.note-card { max-width: 1000px; margin: 0 0 25px; padding: 20px 24px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); }
.note-card h2 { margin-top: 0; color: var(--navy); font-size: 1.3rem; }
.note-card p:last-child { margin-bottom: 0; }
.search-results, .storage-notice { margin: 0 auto 20px; max-width: 1328px; padding: 18px 23px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.search-results h2 { font-size: 1.1rem; margin: 0 0 10px; }
.search-results ol { margin: 0; padding-left: 22px; }
.search-results li { margin: 10px 0; }
.search-results p { margin: 3px 0 0; color: #46536a; font-size: .85rem; }
.storage-notice { border-color: #a06d57; background: #f7e9e1; }
.storage-notice button { margin-left: 12px; }
footer { display: flex; justify-content: center; padding: 24px 70px 90px; font-size: .9rem; border-top: 1px solid var(--line); }
#back-top { position: fixed; right: 18px; bottom: 18px; width: 46px; height: 46px; display: grid; place-items: center; padding: 0; border: 1px solid #7e8998; border-radius: 50%; background: #fffdf8; color: var(--navy); box-shadow: 0 8px 22px #09182c33; font-weight: 900; font-size: 1.15rem; z-index: 30; }
.bump { animation: card-bump .58s cubic-bezier(.22,1.3,.36,1); }
.bump .stamp { animation: stamp-pop .58s cubic-bezier(.22,1.3,.36,1); }
@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.42); } 58% { transform: scale(.92); } 100% { opacity: 1; transform: none; } }
@media(max-width:760px) {
  .language-bar { padding: 8px 80px 8px 18px; gap: 7px 10px; }
  .guides-link { font-size: .78rem; }
  .languages button { min-height: 34px; padding: 4px 10px; font-size: .75rem; }
  .hero-inner { padding: 27px 20px 25px; }
  h1 { font-size: clamp(1.55rem,7vw,2.15rem); }
  html[lang="en"] h1 { font-size: clamp(1.55rem,7.38vw,2.15rem); }
  #edition { font-size: .78rem; }
  #categories { gap: 19px; padding: 6px 20px; }
  #categories a { font-size: .84rem; }
  .floating-progress { top: 10px; right: 10px; width: 58px; height: 58px; font-size: .9rem; border-width: 2px; }
  .toolbar { display: grid; grid-template-columns: minmax(0,1fr); justify-content: stretch; align-items: stretch; padding: 14px; gap: 12px; }
  .tools { justify-content: flex-end; }
  main { padding: 10px 76px 60px 14px; }
  .warnings { padding: 16px; }
  .layout { display: block; }
  .contents { position: static; max-height: none; margin-bottom: 20px; padding: 14px 16px; }
  .progress-card { padding: 17px; }
  .progress-card .progress-heading { display: block; }
  .progress-number { font-size: 1.2rem; margin-top: 5px; }
  .chapter > summary { padding: 16px; font-size: 1.05rem; }
  .chapter-body { padding: 0 10px 12px; }
  .route-card { padding: 16px 14px; padding-top: 55px; }
  .route-card input { left: 15px; top: 17px; }
  .route-card .tag { position: absolute; top: 15px; left: 52px; }
  .route-card.is-complete { padding-bottom: 62px; }
  .route-card ol { padding-left: 1.25em; }
  td { min-width: 170px; }
  tbody th { min-width: 150px; }
  th,td { padding: 11px; }
  .search-results,.storage-notice { margin-left: 14px; margin-right: 76px; padding: 15px; }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .language-bar,.category-nav,.toolbar,.contents,.controls,.floating-progress,#back-top,.references,.search-results,.storage-notice,footer { display: none !important; }
  :root { background: white; color: black; }
  .hero { background: white; color: black; }
  #edition { color: black; }
  h1 { font-size: 24pt; }
  .hero-inner,main { padding: 8px; }
  .layout { display: block; }
  .chapter,.route-card,.note-card { box-shadow: none; }
  .route-card { break-inside: avoid; }
  .table-wrap { overflow: visible; }
  table { font-size: 9pt; }
  th,td { min-width: 0 !important; max-width: none; padding: 5px; }
}
