:root {
  color-scheme: light;
  --navy: #17375f;
  --navy-light: #1d3f6b;
  --paper: #f2efe7;
  --panel: #fffef9;
  --ink: #15233d;
  --muted: #46536a;
  --link: #075b9a;
  --gold: #a76800;
  --line: #bcaf99;
  --green: #237858;
  --red: #b3332f;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 20px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Yu Gothic UI", "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.78;
}
a { color: var(--link); text-underline-offset: .2em; }
a:hover { color: #033d66; }
button, input { font: inherit; }
button { cursor: pointer; }
button, .button-link {
  min-height: 42px;
  padding: 7px 15px;
  border: 1px solid #95856c;
  border-radius: 9px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 700;
}
button:hover { background: #efe8d9; }
:focus-visible { outline: 3px solid #b67719; outline-offset: 3px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 1000; padding: 8px; background: white; }
.skip-link:focus { top: 12px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  min-height: 54px;
  padding: 8px max(100px, calc((100vw - 1440px) / 2 + 100px)) 8px max(24px, calc((100vw - 1440px) / 2 + 24px));
  background: #eee8dc;
  border-bottom: 1px solid var(--line);
}
.guides-link { font-size: .88rem; font-weight: 750; }
.language-switch { display: flex; gap: 8px; }
.language-switch button { min-height: 34px; padding: 4px 14px; border-radius: 99px; font-size: .82rem; }
.language-switch button[aria-pressed="true"] { background: var(--navy); color: white; border-color: var(--navy); }
.hero { background: linear-gradient(118deg, var(--navy), var(--navy-light)); color: #fff; }
.hero-inner { max-width: 1440px; 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;
  text-wrap: balance;
}
.hero-title-part { display: inline-block; white-space: nowrap; }
html[lang="en"] h1 { font-size: clamp(1.8rem, 3.7vw, 3.25rem); }
.categories { overflow-x: auto; background: var(--panel); border-bottom: 1px solid #b3bdc8; box-shadow: 0 3px 12px #14233c12; }
.categories-inner { display: flex; align-items: center; gap: 24px; width: max-content; min-width: min(100%, 1440px); margin: auto; padding: 11px clamp(24px, 5.2vw, 80px) 10px; }
.categories a { display: inline-flex; align-items: center; min-height: 32px; font-size: .94rem; font-weight: 850; text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; }
.categories a[aria-current="page"] { color: var(--navy); border-bottom-color: var(--gold); }
.toolbar-zone { max-width: 1440px; margin: auto; padding: 17px clamp(20px, 4vw, 58px) 0; padding-right: 90px; }
.tools { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-bottom: 13px; }
.search-box { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 12px; padding: 13px; border: 1px solid #aab8cb; border-radius: 11px; background: #f9f7f0; box-shadow: 0 4px 12px #15233d09; }
.search-box label { font-size: .87rem; font-weight: 750; }
.search-box input { min-width: min(240px, 100%); flex: 1 1 320px; min-height: 44px; width: 100%; border: 1px solid #8093ac; border-radius: 7px; padding: 8px 12px; background: #fff; color: var(--ink); }
.search-box button { min-height: 40px; }
.search-results { max-height: 65vh; overflow-y: auto; margin-top: 10px; padding: 20px; border: 1px solid #aab8cb; border-radius: 11px; background: var(--panel); }
.search-results h2 { margin: 0 0 10px; font-size: 1rem; }
.search-results ol { margin: 0; padding-left: 23px; }
.search-results li { padding: 9px 0; }
.search-results li > a { display: block; min-height: 44px; padding: 5px 0; font-weight: 700; }
.result-category { color: var(--gold); font-size: .8rem; font-weight: 750; }
.result-context { display: block; color: var(--muted); font-size: .87rem; line-height: 1.55; }
.status { margin: 12px 0 0; padding: 10px 13px; border: 1px solid #a76d3a; border-radius: 8px; background: #fbefd9; font-size: .9rem; }
.status button { margin: 6px 0 0; }
main { max-width: 1440px; margin: auto; padding: 24px clamp(20px, 4vw, 58px) 64px; padding-right: 90px; }
.edition { color: var(--muted); margin: 0 0 16px; font-size: .85rem; }
.notice { margin-bottom: 20px; padding: 16px 20px; border: 1px solid #a96755; border-radius: 13px; background: #f7e9e0; }
.notice h2 { font-size: 1rem; margin: 0 0 7px; }
.notice ul { margin: 0; padding-left: 22px; }
.notice li + li { margin-top: 3px; }
.progress-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 24px; align-items: center; padding: 22px 24px; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(110deg, var(--panel), #f8f2e5); margin-bottom: 26px; }
.progress-panel h2 { margin: 0 0 5px; font-size: 1rem; color: var(--link); }
.progress-panel p { margin: 0 0 10px; font-size: .88rem; color: var(--muted); }
.progress-track { height: 10px; border: 1px solid #a6977d; background: #e7e0d2; border-radius: 99px; overflow: hidden; }
.progress-fill { width: 0; height: 100%; background: var(--green); transition: width .45s ease; }
.progress-summary { display: grid; justify-items: end; gap: 8px; }
.progress-number { font-size: 1.45rem; font-weight: 750; color: #926100; font-variant-numeric: tabular-nums; }
.progress-bubble { position: fixed; right: 14px; top: 12px; z-index: 80; display: grid; place-items: center; width: 70px; height: 70px; border: 3px solid #284e79; border-radius: 50%; background: #fffdf9f5; box-shadow: 0 5px 18px #15233d30, inset 0 0 0 4px #fff; color: #195a43; font-size: 1rem; font-weight: 850; pointer-events: none; }
.progress-bubble.bump { animation: progress-pop .64s ease; }
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 34px; align-items: start; }
.contents { position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow-y: auto; background: var(--panel); border: 1px solid #ab997f; border-radius: 18px; padding: 20px 18px; box-shadow: 0 10px 26px #14233c0c; }
.contents h2 { margin: 0 0 12px; font-size: .85rem; color: var(--gold); letter-spacing: .09em; }
.contents a { display: block; padding: 7px 5px; font-size: .9rem; text-decoration: none; color: #374151; }
.contents a:hover { color: var(--link); text-decoration: underline; }
.contents .toc-section { margin: 10px 0 4px; padding-top: 9px; border-top: 1px solid #cabcaa; }
.panel { margin: 0 0 24px; padding: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 5px 15px #15233d08; }
.panel > h2 { margin: 0 0 16px; font-size: 1.45rem; color: var(--navy); }
.panel p { margin: 0 0 12px; }
.basic-list { margin: 0; padding-left: 22px; }
.basic-list li + li { margin-top: 11px; }
.chapter-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chapter { border: 1px solid var(--line); border-radius: 17px; background: #eae3d4; margin: 0 0 22px; overflow: clip; }
.chapter > summary { background: var(--panel); padding: 20px 22px; cursor: pointer; font-size: 1.28rem; font-weight: 850; color: var(--navy); }
.chapter > summary:hover { background: #f8f2e7; }
.chapter-body { padding: 20px; }
.route-card { position: relative; padding: 19px 20px 20px 62px; border: 1px solid #c4b69f; border-radius: 15px; background: var(--panel); margin: 0 0 14px; box-shadow: 0 4px 11px #15233d0b; }
.route-card:last-child { margin-bottom: 0; }
.route-check { position: absolute; left: 21px; top: 24px; width: 24px; height: 24px; margin: 0; accent-color: #087a59; cursor: pointer; }
.route-card h3 { margin: 0 0 10px; font-size: 1.05rem; line-height: 1.55; }
.route-card h3 label { cursor: pointer; }
.route-card ol { padding-left: 21px; margin: 0; }
.route-card li + li { margin-top: 6px; }
.route-note { margin: 13px 0 0 !important; padding: 11px 13px; border: 1px solid #bba98b; border-radius: 8px; background: #f4ead7; font-size: .9rem; font-weight: 650; }
.related { display: flex; flex-wrap: wrap; gap: 7px 12px; margin-top: 12px; font-size: .88rem; }
.related a { display: inline-block; }
.route-card.complete { padding-bottom: 60px; border-color: var(--green); }
.stamp { position: absolute; right: 15px; bottom: 12px; display: grid; place-items: center; width: 64px; height: 32px; border: 2px solid var(--red); border-radius: 4px 6px 5px 3px; color: var(--red); background: radial-gradient(circle at 18% 25%, #fffdf8 0 1px, transparent 1.4px) 0 0 / 9px 8px, #fffdf8e0; font-weight: 900; font-size: .93rem; letter-spacing: .08em; line-height: 1; transform: none; text-shadow: .35px 0 #8c3127; }
.route-card.bump { animation: card-pop .58s ease; }
.route-card.bump .stamp { animation: stamp-pop .58s ease; }
@keyframes card-pop { 0% { transform: scale(1); } 36% { transform: scale(1.012); } 70% { transform: scale(.998); } 100% { transform: scale(1); } }
@keyframes stamp-pop { 0% { opacity: 0; transform: scale(1.4); } 58% { opacity: 1; transform: scale(.93); } 100% { transform: scale(1); } }
@keyframes progress-pop { 0%, 100% { transform: scale(1); } 35% { transform: scale(1.16); } 68% { transform: scale(.96); } }
.table-wrap { overflow-x: auto; max-width: 100%; border: 1px solid #acb8c8; border-radius: 10px; background: white; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; line-height: 1.65; }
table.wide { min-width: 1060px; }
table.medium { min-width: 840px; }
th { background: #233e65; color: #fff; font-weight: 750; white-space: nowrap; text-align: left; }
th, td { padding: 11px 12px; border: 1px solid #d0d8e2; vertical-align: top; }
thead tr:first-child th { border-top: 0; }
td:first-child, th:first-child { min-width: 150px; border-left: 0; }
td:last-child, th:last-child { border-right: 0; }
tbody tr:nth-child(even) { background: #f0f3f7; }
tbody tr:hover { background: #fff4dc; }
td strong { font-weight: 750; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.small { font-size: .88rem; color: var(--muted); }
.supplement { background: #faf3e4; border: 1px solid #b8a27b; border-radius: 11px; padding: 16px 19px; margin-bottom: 20px; }
.supplement p { margin: 0; }
.story { margin-top: 16px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 10px; background: #f5efe4; }
.story summary { cursor: pointer; font-weight: 700; }
.story p { margin: 10px 0 0; }
footer { padding: 26px 78px 40px; text-align: center; border-top: 1px solid #c7baa6; background: #eae4d8; }
footer a { font-weight: 750; }
.back-top { position: fixed; right: 18px; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 90; display: grid; place-items: center; width: 46px; height: 46px; min-height: 46px; padding: 0; border: 1px solid #7e8998; border-radius: 50%; background: #fffdf8; color: var(--navy); box-shadow: 0 7px 20px #09182c30; font-size: 1.2rem; line-height: 1; }
.document-end { padding-bottom: 38px; }
@media (max-width: 760px) {
  .topbar { padding: 8px 80px 8px 20px; gap: 5px; }
  .topbar .guides-link { width: 100%; font-size: .82rem; }
  .language-switch { gap: 7px; }
  .language-switch button { min-height: 36px; padding: 4px 13px; }
  .hero-inner { padding: 28px 70px 25px 20px; }
  h1 { font-size: clamp(1.55rem, 7vw, 2.15rem); text-wrap: balance; }
  html[lang="en"] h1 { font-size: clamp(1.6rem, 7.3vw, 2.2rem); }
  .categories { margin-right: 70px; }
  .categories-inner { padding: 9px 20px 8px; gap: 20px; }
  .categories a { font-size: .86rem; }
  .toolbar-zone { padding: 14px 70px 0 15px; }
  .tools { justify-content: flex-start; }
  .tools button { min-height: 44px; padding: 7px 12px; font-size: .88rem; }
  .search-box { gap: 7px; }
  .search-box label { width: 100%; }
  .search-box input { flex-basis: 100%; min-width: 0; font-size: 16px; }
  .search-results { padding: 15px; }
  main { padding: 20px 70px 58px 15px; }
  .notice { padding: 14px 16px; }
  .notice ul { padding-left: 20px; font-size: .91rem; }
  .progress-panel { grid-template-columns: 1fr; padding: 18px; gap: 13px; }
  .progress-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
  .progress-number { font-size: 1.23rem; }
  .progress-bubble { width: 58px; height: 58px; top: 10px; right: 10px; border-width: 2px; font-size: .9rem; }
  .layout { display: flex; flex-direction: column; gap: 22px; }
  .contents { position: static; width: 100%; max-height: none; padding: 16px; }
  .contents a { padding: 7px 4px; }
  .walkthrough { width: 100%; min-width: 0; }
  .panel { padding: 18px 16px; }
  .panel > h2 { font-size: 1.24rem; }
  .chapter > summary { padding: 17px 16px; font-size: 1.14rem; }
  .chapter-body { padding: 12px 10px; }
  .route-card { padding: 54px 15px 18px; }
  .route-card.complete { padding-bottom: 60px; }
  .route-check { left: 15px; top: 16px; }
  .route-card h3 { font-size: 1.04rem; }
  .route-card ol { padding-left: 21px; }
  .route-card li + li { margin-top: 9px; }
  table { font-size: .87rem; }
  td:first-child, th:first-child { min-width: 155px; }
  th, td { padding: 10px; }
  footer { padding: 23px 76px 34px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .topbar, .categories, .toolbar-zone, .contents, .tools, .back-top, .progress-bubble, .chapter-actions, .progress-reset, footer { display: none !important; }
  body { background: white; color: #000; font-size: 10pt; }
  .hero { background: white; color: #000; }
  .hero-inner { padding: 8mm 0; }
  h1 { font-size: 22pt !important; }
  main { max-width: none; padding: 0; }
  .layout { display: block; }
  .chapter, .panel { box-shadow: none; }
  .chapter-body { padding: 8px; }
  .route-card { break-inside: avoid; box-shadow: none; }
  .table-wrap { overflow: visible; }
  table.wide, table.medium { min-width: 0; font-size: 8pt; }
  th, td { padding: 5px; }
  td:first-child, th:first-child { min-width: 0; }
}

.collection-check { display: flex; align-items: flex-start; gap: 10px; }
.collection-check input { flex: 0 0 24px; width: 24px; height: 24px; margin: 9px 0 0; accent-color: var(--green); }
.collection-check label { display: block; min-height: 44px; padding: 6px 0; font-weight: 750; cursor: pointer; }
.collection-row.complete { outline: 1px solid var(--green); outline-offset: -1px; background: #f3faf5; }
.inline-stamp { position: static; margin-top: 10px; }
.collection-row.bump .inline-stamp { animation: stamp-pop .58s ease; }
@media (prefers-reduced-motion: reduce) {
  .collection-row.bump .inline-stamp { animation: none !important; }
}

#item-table th:nth-child(4), #item-table td:nth-child(4) { min-width: 90px; white-space: nowrap; }

.section-index { display:flex; flex-wrap:wrap; gap:12px 22px; margin:22px 0; }
.data-table th:first-child, .data-table td:first-child { min-width:160px; }
.data-table td { min-width:145px; vertical-align:top; }
.data-table td:has(.cell-steps) { min-width:330px; }
.data-table:has(.check-state) { table-layout:auto; }
.check-state .collection-check { flex-wrap:wrap; }
.check-state .collection-check span { min-width:0; overflow-wrap:anywhere; }
.cell-steps { margin:0; padding-left:1.3em; }
.cell-steps li + li { margin-top:8px; }
.mail-code p { margin: 0 0 7px; font-weight: 700; }
.mail-code pre { margin: 0 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: Consolas, "Yu Gothic UI", monospace; line-height: 1.8; }
.mail-code code { font: inherit; }
@media (max-width: 800px) { .mail-code { max-width: min(14rem, calc(100vw - 144px)); } }
.check-state { min-width:130px; padding:8px; border:1px solid transparent; border-radius:8px; }
.check-state.complete { background:#f1faf5; border-color:#237858; }
.check-state .inline-stamp { margin-top:12px; }
.check-state input { flex:0 0 auto; }
.battle-preparation { margin:0 0 24px; padding:0 4px 18px; border-bottom:1px solid #acb8c8; }
.battle-preparation h3 { margin-top:0; }
.battle-preparation h4 { margin-bottom:8px; break-after:avoid; }
@media print { .check-state { break-inside:avoid; } }

.edition-choice { display: flex; align-items: center; gap: 8px; max-width: 100%; color: var(--ink); }
.edition-choice > span { font-size: .88rem; font-weight: 700; }
.edition-choice select { min-height: 44px; max-width: 100%; padding: 7px 12px; border: 1px solid #95856c; border-radius: 9px; background: var(--panel); color: var(--ink); font: inherit; }
@media (max-width: 760px) {
  .edition-choice { flex-basis: 100%; }
  .edition-choice select { flex: 1; min-width: 0; }
}
