:root {
  color-scheme: light;
  --navy: #17375f;
  --navy-light: #1d3f6b;
  --paper: #fffef9;
  --background: #f2efe7;
  --ink: #111827;
  --muted: #374151;
  --blue: #075b9a;
  --gold: #9a6500;
  --green: #237858;
  --red: #b3332f;
  --line: #c4b8a4;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 96px; }
body {
  margin: 0;
  min-width: 320px;
  background: linear-gradient(180deg, #e8e1d3, var(--background) 40rem);
  color: var(--ink);
  font: 16px/1.78 "Yu Gothic UI", "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  letter-spacing: .012em;
}
a { color: var(--blue); text-underline-offset: .2em; }
button, input { font: inherit; }
button {
  min-height: 40px;
  padding: 7px 14px;
  border: 1px solid #95866e;
  border-radius: 9px;
  background: #fffdf8;
  color: #263244;
  font-weight: 700;
  cursor: pointer;
  transition: background .16s, transform .16s;
}
button:hover { background: #f1e8d7; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible, .table-scroll:focus-visible {
  outline: 3px solid #b37819;
  outline-offset: 3px;
}
.skip-link { position: fixed; top: -120px; left: 12px; z-index: 1000; padding: 10px; background: white; }
.skip-link:focus { top: 8px; }
.language-strip {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px max(104px, calc((100vw - 1480px) / 2 + 104px)) 8px 18px;
  border-bottom: 1px solid var(--line);
  background: #eee8dc;
}
.language-strip button { min-height: 34px; padding: 4px 14px; border-radius: 999px; font-size: .82rem; }
.language-strip [aria-pressed="true"] { background: var(--navy); color: white; border-color: var(--navy); }
#site-header {
  background: radial-gradient(circle at 83% -55%, #ffffff20, transparent 31rem),
    linear-gradient(118deg, var(--navy), var(--navy-light));
  color: white;
}
.header-inner { max-width: 1480px; margin: auto; padding: 24px clamp(24px,5.2vw,80px) 32px; }
.guides-back { color: #fff; font-size: .86rem; }
.edition { margin: 10px 0 6px; color: #f0e4c5; font-size: .88rem; font-weight: 700; }
h1 { margin: 0; font: 700 clamp(2rem,3.6vw,3.1rem)/1.28 YuMincho,"Yu Mincho","Hiragino Mincho ProN",serif; text-wrap: balance; }
.title-piece { display: inline-block; max-width: 100%; }
html[lang="en"] h1 { font-size: clamp(1.8rem,3.25vw,2.8rem); }
.category-nav { overflow-x: auto; background: #fffdf8; border-bottom: 1px solid #aeb8c7; box-shadow: 0 3px 12px #14233c12; }
.category-nav > div { display: flex; gap: 24px; width: max-content; min-width: min(100%,1480px); margin: auto; padding: 10px clamp(24px,5.2vw,80px); }
.category-nav a { display: inline-flex; align-items: center; min-height: 32px; white-space: nowrap; text-decoration: none; border-bottom: 2px solid transparent; font-size: .92rem; font-weight: 850; }
.category-nav [aria-current="page"] { color: var(--navy); border-color: var(--gold); }
.toolbar { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; max-width: 1440px; margin: auto; padding: 13px clamp(20px,4vw,56px); }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#sound-toggle[aria-pressed="true"] { color: #155a42; border-color: var(--green); background: #e6f4ed; }
.search-shell { max-width: 1328px; margin: 0 auto 18px; padding: 12px 16px; border: 1px solid #b8ac97; border-radius: 12px; background: #fffdf8d9; }
#guide-search-form > label { display: block; margin-bottom: 5px; font-size: .86rem; color: var(--navy); font-weight: 800; }
.search-controls { display: flex; gap: 10px; }
.search-controls button { flex: 0 0 auto; white-space: nowrap; }
#guide-search { min-width: 0; width: 100%; padding: 9px 12px; border: 1px solid #8394ac; border-radius: 7px; color: var(--ink); background: white; }
.result-count { margin: 12px 0 6px; font-weight: 800; }
.results-list { list-style: none; max-height: 420px; overflow: auto; padding: 0 8px 0 0; margin: 0; }
.results-list li { padding: 12px 0; border-top: 1px solid var(--line); }
.results-list p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.result-category { display: inline-block; margin-right: 10px; color: var(--gold); font-size: .8rem; font-weight: 800; }
.results-list a { font-weight: 800; }
.opening-alert { max-width: 1328px; margin: 0 auto 8px; padding: 14px 18px; border: 1px solid #b86d50; border-radius: 12px; background: #f7e7df; }
.opening-alert strong { color: #713a23; }
.opening-alert p { margin: 3px 0; font-size: .94rem; }
.storage-status { max-width: 1328px; margin: 12px auto; padding: 14px 18px; border: 1px solid #a97521; border-radius: 10px; background: #fff3d5; }
.storage-status p { margin: 0 0 8px; }
[hidden] { display: none !important; }
.guide-layout { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 34px; max-width: 1440px; margin: auto; padding: 26px clamp(20px,4vw,56px) 80px; }
.guide-layout.no-contents { grid-template-columns: minmax(0,1fr); }
.contents { position: sticky; top: 20px; align-self: start; max-height: calc(100vh - 40px); overflow: auto; padding: 16px; border: 1px solid #a99a83; border-radius: 18px; background: var(--paper); box-shadow: 0 14px 35px #40301a12; }
.contents h2 { margin: 0 0 10px; color: var(--gold); font-size: .82rem; letter-spacing: .12em; }
.contents a { display: block; padding: 7px 8px; color: var(--muted); font-size: .86rem; line-height: 1.45; text-decoration: none; border-radius: 6px; }
.contents a:hover { color: var(--blue); background: #f4ecdc; }
main { min-width: 0; outline: none; }
.progress-card { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 22px; margin-bottom: 24px; padding: 22px 24px; border: 1px solid #cbbda7; border-radius: 17px; background: linear-gradient(135deg,#fffefa,#f7f1e5); box-shadow: 0 10px 28px #40301a18; }
.progress-card h2 { margin: 0 0 4px; color: var(--navy); font-size: 1rem; }
.progress-card p { margin: 0; font-size: .86rem; color: var(--muted); }
.progress-track { height: 11px; margin-top: 12px; overflow: hidden; border: 1px solid #b7a78d; border-radius: 99px; background: #e9e2d6; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg,#237858,#d29b2e); transition: width .25s; }
.progress-actions { display: grid; justify-items: end; gap: 12px; }
.progress-number { color: #875b06; font-size: 1.25rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart-heading { margin-bottom: 18px; }
.chart-heading h2 { margin: 0 0 12px; font-size: 1.4rem; }
.details-controls { display: flex; flex-wrap: wrap; gap: 10px; }
.chapter { margin: 0 0 20px; overflow: clip; border: 1px solid #ad9c80; border-radius: 17px; background: #ebe3d3; }
.chapter > summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 22px; background: var(--paper); cursor: pointer; list-style: none; }
.chapter > summary::-webkit-details-marker { display: none; }
.chapter > summary h2 { margin: 0; font-size: 1.22rem; line-height: 1.5; color: var(--navy); }
.chapter-chevron { flex: 0 0 30px; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #b19b75; border-radius: 50%; color: var(--gold); }
.chapter-chevron::after { content: "+"; }
.chapter[open] .chapter-chevron::after { content: "−"; }
.chapter-body { padding: 20px; }
.route-card { position: relative; padding: 20px 22px; margin-bottom: 13px; border: 1px solid #c5b79e; border-radius: 14px; background: var(--paper); box-shadow: 0 5px 12px #40301a0c; }
.route-card:last-child { margin-bottom: 0; }
.route-head { display: flex; align-items: flex-start; gap: 15px; }
.route-head h3 { margin: 0; font-size: 1rem; line-height: 1.6; }
.route-head label { cursor: pointer; }
.route-check { flex: 0 0 23px; width: 23px; height: 23px; margin: 3px 0 0; accent-color: #087653; cursor: pointer; }
.route-card ol { margin: 12px 0 0 40px; padding-left: 20px; }
.route-card li { padding: 2px 0; }
.step-note { margin: 14px 0 0 40px; padding: 11px 13px; border: 1px solid #c6b79a; border-radius: 8px; background: #f4ecda; font-size: .88rem; font-weight: 700; }
.reference-links { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; }
.reference-links a { font-size: .86rem; font-weight: 700; }
.completion-stamp { display: none; position: absolute; right: 15px; bottom: 12px; width: 62px; height: 31px; place-items: center; border: 2px solid #b3332fea; border-radius: 4px 6px 5px 3px; color: var(--red); background: radial-gradient(circle at 16% 28%,#fffdf8eb 0 1px,transparent 1.35px) 0 0 / 9px 8px, #fffdf8db; font-size: .91rem; font-weight: 900; letter-spacing: .1em; line-height: 1; box-shadow: inset 0 0 0 1px #b3332f25; transform: none; }
.route-card.is-done { padding-bottom: 58px; border-color: var(--green); opacity: 1; }
.route-card.is-done .completion-stamp { display: grid; }
.route-card.just-checked { animation: card-bump .58s ease-out; }
.route-card.just-checked.is-done .completion-stamp { animation: stamp-pop .58s ease-out; }
@keyframes card-bump { 0%,100% { transform: scale(1); } 38% { transform: scale(1.012); } 70% { transform: scale(.996); } }
@keyframes stamp-pop { 0% { opacity: 0; transform: scale(1.42); } 58% { opacity: 1; transform: scale(.92); } 100% { opacity: 1; transform: scale(1); } }
.data-section { margin-bottom: 22px; padding: 22px; border: 1px solid #b8ac97; border-radius: 15px; background: var(--paper); }
.data-section > h2 { margin: 0 0 14px; color: var(--navy); font-size: 1.35rem; }
.data-section p { margin: 10px 0; }
.data-block h3 { margin: 18px 0 10px; font-size: 1.05rem; }
.table-note { font-size: .9rem; color: var(--muted); }
.table-scroll { max-width: 100%; overflow-x: auto; border: 1px solid #aebad0; border-radius: 9px; }
table { width: 100%; min-width: 690px; border-collapse: collapse; font-size: .9rem; line-height: 1.6; }
th, td { padding: 11px 12px; border-right: 1px solid #d1dae5; border-bottom: 1px solid #c5cfdd; text-align: left; vertical-align: top; }
th:last-child, td:last-child { border-right: 0; }
tbody tr:last-child > * { border-bottom: 0; }
thead th { background: #213f66; color: white; font-weight: 800; white-space: nowrap; }
tbody th { min-width: 9rem; width: 16%; font-weight: 800; }
tbody tr:nth-child(even) { background: #eff3f7; }
tbody tr:target, article:target { outline: 3px solid #bd8833; outline-offset: -3px; }
td .reference-links { margin-top: 7px; }
.floating-progress { position: absolute; z-index: 500; top: 12px; right: 15px; display: grid; place-items: center; width: 72px; height: 72px; border: 3px solid #1d3f6bf0; border-radius: 50%; background: #fffdf8f7; color: #194a3c; box-shadow: 0 8px 24px #09182c33,inset 0 0 0 3px white; font-weight: 900; pointer-events: none; }
.floating-progress.bump { animation: progress-bump .64s ease-out; }
@keyframes progress-bump { 0%,100% { transform: scale(1); } 35% { transform: scale(1.18); } 68% { transform: scale(.93); } }
.back-top { position: fixed; z-index: 520; right: max(18px,env(safe-area-inset-right)); bottom: max(18px,env(safe-area-inset-bottom)); 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 8px 22px #09182c33; font-size: 1.15rem; font-weight: 900; }
footer { padding: 28px 80px 70px; text-align: center; border-top: 1px solid var(--line); background: #eee8dc; }
footer a { font-weight: 800; }
html[lang="en"] .route-card, html[lang="en"] table { line-height: 1.65; }
@media (max-width: 1390px) { .search-shell,.opening-alert,.storage-status { margin-left: 4vw; margin-right: 4vw; } }
@media (max-width: 760px) {
  .header-inner { padding: 20px 20px 25px; }
  .guides-back { font-size: .8rem; }
  .edition { font-size: .78rem; }
  h1 { font-size: clamp(1.55rem,7vw,2.15rem); line-height: 1.3; }
  html[lang="en"] h1 { font-size: clamp(1.55rem,7.2vw,2.15rem); }
  .category-nav > div { padding: 9px 20px; gap: 20px; }
  .category-nav a { font-size: .84rem; }
  .toolbar { padding: 12px 18px; align-items: flex-start; }
  .toolbar-actions { gap: 7px; }
  .toolbar button { font-size: .82rem; }
  .search-shell,.opening-alert,.storage-status { margin-left: 14px; margin-right: 14px; }
  .search-shell { padding: 12px; }
  .search-controls { gap: 7px; }
  #guide-search { font-size: .88rem; }
  .search-controls button { padding: 6px 10px; font-size: .82rem; }
  .opening-alert { padding: 12px 14px; }
  .opening-alert p { font-size: .86rem; }
  .guide-layout { grid-template-columns: minmax(0,1fr); gap: 20px; padding: 18px 14px 75px; }
  .contents { position: static; max-height: none; padding: 14px; border-radius: 14px; }
  .contents nav { display: grid; grid-template-columns: 1fr; }
  .contents a { padding: 7px; font-size: .86rem; }
  .progress-card { grid-template-columns: 1fr; padding: 18px; gap: 14px; }
  .progress-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .progress-actions button { font-size: .82rem; }
  .progress-number { font-size: 1.1rem; }
  .details-controls button { font-size: .85rem; }
  .chapter > summary { padding: 17px 15px; gap: 12px; }
  .chapter > summary h2 { font-size: 1.1rem; }
  .chapter-body { padding: 10px; }
  .route-card { padding: 17px 14px; border-radius: 12px; }
  .route-head { gap: 11px; }
  .route-head h3 { font-size: 1rem; }
  .route-card ol { margin-left: 0; padding-left: 21px; }
  .route-card li { padding: 3px 0; }
  .step-note { margin-left: 0; }
  .reference-links { gap: 7px 12px; }
  .data-section { padding: 17px 14px; }
  .data-section > h2 { font-size: 1.25rem; }
  .table-scroll { margin: 0; }
  table { min-width: 700px; }
  th,td { padding: 10px; }
  .floating-progress { top: 10px; right: 10px; width: 58px; height: 58px; border-width: 2px; font-size: .9rem; }
  footer { padding: 25px 65px 70px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  body { background: white; font-size: 11pt; }
  .language-strip,.category-nav,.toolbar,.search-shell,.contents,.back-top,.floating-progress,.details-controls,.progress-actions,.storage-status,.skip-link,footer { display: none !important; }
  #site-header { background: white; color: black; }
  .header-inner { padding: 0 0 15px; }
  h1,html[lang="en"] h1 { font-size: 22pt; color: black; }
  .guides-back { display: none; }
  .edition { color: black; }
  .opening-alert { max-width: none; margin: 12px 0; background: white; }
  .guide-layout { display: block; padding: 0; }
  .chapter,.route-card,.data-section,.progress-card { box-shadow: none; break-inside: avoid; }
  .table-scroll { overflow: visible; }
  table { min-width: 0; font-size: 9pt; }
  .completion-stamp { print-color-adjust: exact; }
}
