:root {
  color-scheme: light;
  --navy: #17375f;
  --navy-light: #1d3f6b;
  --paper: #fffef9;
  --ground: #f2efe7;
  --ink: #172235;
  --blue: #075b9a;
  --gold: #986200;
  --line: #b8ab96;
  --green: #237858;
  --red: #b3332f;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 16px/1.78 "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
}
a { color: var(--blue); text-underline-offset: .2em; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button, .button {
  min-height: 42px;
  padding: 7px 15px;
  border: 1px solid #7e8998;
  border-radius: 9px;
  background: var(--paper);
  color: var(--navy);
  font-weight: 700;
}
button:hover, .button:hover { background: #ede7da; }
:focus-visible { outline: 3px solid #b77c28; outline-offset: 4px; }
.skip { position: absolute; top: -100px; left: 18px; z-index: 1000; }
.skip:focus { top: 8px; background: white; padding: 10px; }
.language-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-height: 54px;
  padding: 7px 112px 7px clamp(20px,5.2vw,80px);
  background: #eee8dc;
  border-bottom: 1px solid var(--line);
}
.language-row .guide-home { margin-right: auto; font-size: .84rem; }
.language-row button { min-height: 34px; border-radius: 999px; font-size: .82rem; }
.language-row button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.hero { background: linear-gradient(118deg,var(--navy),var(--navy-light)); color: #fff; }
.hero-inner { max-width: 1480px; margin: auto; padding: 30px clamp(24px,5.2vw,80px) 34px; }
.edition { margin: 0 0 8px; font-size: .86rem; letter-spacing: .04em; }
h1 {
  margin: 0;
  max-width: 1240px;
  font: 700 clamp(2rem,3.75vw,3.45rem)/1.24 YuMincho,"Yu Mincho",serif;
  text-wrap: balance;
  line-break: strict;
}
html[lang="en"] h1 { font-size: clamp(1.8rem,3.7vw,3.25rem); }
.categories { background: var(--paper); border-bottom: 1px solid #aeb8c7; box-shadow: 0 3px 12px #14233c12; overflow-x: auto; }
.categories-inner { display: flex; gap: 24px; width: max-content; min-width: min(100%,1480px); margin: auto; padding: 10px clamp(20px,5.2vw,80px); }
.categories a { padding: 4px 0; white-space: nowrap; text-decoration: none; font-weight: 800; font-size: .92rem; border-bottom: 2px solid transparent; }
.categories a[aria-current="page"] { border-bottom-color: var(--gold); color: var(--navy); }
.progress-bubble {
  position: fixed; z-index: 30; top: 12px; right: 18px;
  width: 72px; height: 72px; border: 3px solid var(--navy);
  border-radius: 50%; background: #fffdf8f5; box-shadow: 0 6px 18px #102a3b24;
  display: grid; place-items: center; color: #194a3c; font-weight: 850;
  font-variant-numeric: tabular-nums; pointer-events: none;
}
.progress-bubble.bump { animation: progress-bump .64s ease; }
.tools-wrap { max-width: 1440px; margin: 0 auto; padding: 20px clamp(20px,4vw,56px) 0; }
.tools { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.search-field { flex: 1 1 330px; min-width: 0; }
.search-field label { display: block; margin-bottom: 4px; color: var(--navy); font-size: .86rem; font-weight: 750; }
.search-field input { width: 100%; min-width: 0; height: 44px; padding: 8px 12px; border: 1px solid #8295ae; border-radius: 7px; background: #fff; }
.tool-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.search-results { margin-top: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.search-results[hidden] { display: none; }
.search-results ol { padding-left: 24px; max-height: 420px; overflow: auto; }
.search-results li { margin-bottom: 12px; }
.search-context { display: block; font-size: .88rem; color: #455267; }
.search-category { font-weight: 800; color: var(--gold); margin-right: 8px; }
.notice { margin-top: 18px; padding: 17px 20px; border: 1px solid #9f4f3c; border-radius: 14px; background: #f6e8df; }
.notice strong { display: block; margin-bottom: 4px; }
.notice p { margin: 0; }
.storage-status { padding: 14px; margin-top: 14px; background: #fff4db; border: 1px solid #ae782c; border-radius: 10px; }
.storage-status[hidden] { display: none; }
.layout { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 34px; max-width: 1440px; margin: 0 auto; padding: 28px clamp(20px,4vw,56px) 50px; }
.toc { position: sticky; top: 24px; align-self: start; max-height: calc(100vh - 48px); overflow: auto; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: 0 12px 30px #493b2310; }
.toc h2 { margin: 0 0 8px; font-size: .82rem; color: var(--gold); }
.toc a { display: block; margin: 3px 0; padding: 6px 7px; font-size: .86rem; text-decoration: none; border-radius: 6px; }
.toc a:hover { background: #efe9dc; }
main { min-width: 0; }
.progress-panel, .section, .chapter { border: 1px solid var(--line); border-radius: 17px; background: var(--paper); box-shadow: 0 7px 20px #392d1810; margin: 0 0 24px; }
.progress-panel { padding: 20px 24px; background: #fbf7ed; }
.progress-panel h2 { margin: 0; font-size: 1.05rem; color: var(--navy); }
.progress-summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.progress-summary strong { color: var(--gold); font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.progress-panel p { margin: 8px 0 0; font-size: .86rem; }
progress { appearance: none; width: 100%; height: 11px; border: 1px solid #a89a80; border-radius: 8px; overflow: hidden; background: #e9e3d6; }
progress::-webkit-progress-bar { background: #e9e3d6; }
progress::-webkit-progress-value { background: var(--green); transition: width .4s ease; }
.chart-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.chapter { background: #ebe3d3; }
.chapter > summary { display: flex; justify-content: space-between; gap: 16px; padding: 22px; cursor: pointer; background: var(--paper); border-radius: 17px; list-style: none; font-weight: 800; color: var(--navy); font-size: 1.15rem; }
.chapter > summary::-webkit-details-marker { display: none; }
.chapter > summary::after { content: "+"; font-size: 1.1rem; color: var(--gold); }
.chapter[open] > summary::after { content: "−"; }
.chapter-body { padding: 20px; }
.route-card { position: relative; padding: 20px 22px; margin-bottom: 14px; border: 1px solid #c5b79d; border-radius: 14px; background: var(--paper); box-shadow: 0 4px 10px #34291b0c; }
.route-card:last-child { margin-bottom: 0; }
.route-title { display: flex; align-items: flex-start; gap: 14px; font-weight: 800; line-height: 1.6; }
.route-title input { appearance: auto; accent-color: #087653; flex: 0 0 24px; width: 24px; height: 24px; margin: 3px 0 0; cursor: pointer; }
.route-card ol, .route-card ul { padding-left: 29px; margin: 12px 0 0 17px; }
.route-card li { margin: 7px 0; }
.route-card p { margin: 10px 0 0; }
.hint { padding: 11px 14px; border: 1px solid #c6b898; border-radius: 8px; background: #f3ebd8; font-size: .88rem; }
.route-card.done { border-color: var(--green); padding-bottom: 64px; }
.stamp { position: absolute; right: 15px; bottom: 12px; width: 64px; height: 31px; display: none; place-items: center; border: 2px solid var(--red); border-radius: 4px 6px 5px 3px; color: var(--red); font-size: .91rem; font-weight: 900; letter-spacing: .08em; line-height: 1; background: radial-gradient(circle,#fffef9 1px,transparent 1.4px) 0 0/11px 9px,#fffdf8e8; transform: none; }
.done .stamp { display: grid; }
.route-card.bump { animation: card-bump .58s ease; }
.route-card.bump .stamp { animation: stamp-pop .58s ease; }
.section { padding: 24px; }
.section h2 { margin: 0 0 14px; font-size: 1.5rem; color: var(--navy); line-height: 1.45; }
.section h3 { color: var(--navy); margin: 24px 0 8px; font-size: 1.12rem; }
.section p { margin: 10px 0; }
.section ul, .section ol { padding-left: 24px; }
.section li { margin: 9px 0; }
.table-scroll { width: 100%; overflow-x: auto; border: 1px solid #a8b5c9; border-radius: 10px; margin-top: 16px; }
table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: .9rem; line-height: 1.65; }
th { background: #213d64; color: #fff; text-align: left; white-space: nowrap; }
th, td { padding: 11px 12px; border: 1px solid #ccd5e1; vertical-align: top; }
th:first-child, td:first-child { min-width: 145px; }
tbody tr:nth-child(even) { background: #eef2f6; }
td p { margin: 0 !important; }
.table-caption { margin: 10px 0; color: #46536a; font-size: .88rem; }
.data-detail { padding: 16px 0; border-bottom: 1px solid #d6cdbb; }
.data-detail:last-child { border-bottom: 0; }
.data-detail summary { font-weight: 800; cursor: pointer; color: var(--navy); }
.reference-link { display: inline-block; margin-top: 12px; font-weight: 700; }
footer { padding: 24px 85px 40px 24px; text-align: center; }
.back-top { position: fixed; z-index: 40; right: max(18px,env(safe-area-inset-right)); bottom: max(18px,env(safe-area-inset-bottom)); width: 46px; height: 46px; min-height: 46px; padding: 0; border: 1px solid #7e8998; border-radius: 50%; background: #fffdf8; color: var(--navy); box-shadow: 0 8px 22px #09182c38; font-size: 1.15rem; }
[id] { scroll-margin-top: 24px; }
@keyframes progress-bump { 0%,100% { transform: scale(1); } 35% { transform: scale(1.2); } 65% { transform: scale(.92); } }
@keyframes card-bump { 0%,100% { transform: scale(1); } 36% { transform: scale(1.012); } 68% { transform: scale(.995); } }
@keyframes stamp-pop { 0% { transform: scale(1.4); opacity: 0; } 60% { transform: scale(.93); opacity: 1; } 100% { transform: none; opacity: 1; } }
@media (min-width: 761px) {
  .tools-wrap, .layout { padding-right: 112px; }
}
@media (max-width: 760px) {
  .language-row { gap: 6px; padding: 8px 80px 8px 16px; flex-wrap: wrap; }
  .language-row .guide-home, .language-row [data-gtl-guide-return="header"] { flex: 1 1 100%; }
  .language-row button { padding: 4px 11px; }
  .hero-inner { padding: 25px 66px 25px 20px; }
  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 { padding-right: 66px; }
  .categories-inner { padding: 9px 20px; gap: 18px; }
  .categories a { font-size: .84rem; }
  .progress-bubble { width: 58px; height: 58px; top: 12px; right: 10px; border-width: 2px; font-size: .9rem; }
  .tools-wrap { padding: 18px 66px 0 16px; }
  .tools { gap: 10px; }
  .search-field { flex-basis: 100%; }
  .tool-buttons { width: 100%; }
  .tool-buttons button { flex: 1 1 auto; padding: 6px 10px; font-size: .85rem; }
  .notice { padding: 15px; font-size: .93rem; }
  .layout { display: flex; flex-direction: column; gap: 20px; padding: 20px 66px 40px 16px; }
  .toc { position: static; width: 100%; max-height: none; padding: 14px 16px; }
  .toc a { display: inline-block; margin-right: 9px; padding: 5px 0; }
  .section { padding: 20px 16px; }
  .section h2 { font-size: 1.3rem; }
  .chapter > summary { padding: 20px 16px; font-size: 1.05rem; }
  .chapter-body { padding: 12px 10px; }
  .route-card { padding: 18px 15px; }
  .route-title { display: block; }
  .route-title input { display: inline-block; margin-right: 12px; vertical-align: middle; }
  .route-card ol, .route-card ul { padding-left: 23px; margin-left: 0; }
  .progress-panel { padding: 18px; }
  .back-top { right: max(18px,env(safe-area-inset-right)); bottom: max(18px,env(safe-area-inset-bottom)); }
  footer { padding-bottom: 85px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  html { scroll-behavior: auto !important; }
}
@media print {
  .language-row, .categories, .tools-wrap, .toc, .progress-bubble, .chart-actions, .back-top, footer, .progress-panel { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .hero { background: none; color: #000; }
  .hero-inner { padding: 10px 0 20px; }
  h1, html[lang="en"] h1 { font-size: 23pt; }
  .layout { display: block; padding: 0; }
  .section, .chapter, .route-card { box-shadow: none; background: #fff; break-inside: avoid; }
  .table-scroll { overflow: visible; }
  table { min-width: 0; font-size: 9pt; }
  th, td { padding: 5px; }
  th:first-child, td:first-child { min-width: 0; }
}
