:root {
  color-scheme: light;
  --navy: #17375f;
  --navy-light: #1d3f6b;
  --paper: #fffef9;
  --background: #f1eee5;
  --ink: #172132;
  --muted: #536071;
  --line: #c5baa6;
  --link: #075b9a;
  --gold: #98620c;
  --green: #237858;
  --red: #b3332f;
}
* { box-sizing: border-box; }
html { font-family: "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif; font-size: 16px; }
body { margin: 0; color: var(--ink); background: var(--background); overflow: hidden; }
#page-scroll { height: calc(100dvh - 64px); overflow: auto; overflow-x: hidden; scroll-behavior: smooth; }
a { color: var(--link); text-underline-offset: 3px; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; border: 1px solid #9b8d74; border-radius: 9px; padding: 9px 15px; color: var(--ink); background: var(--paper); min-height: 42px; }
button:hover { background: #f5eedf; }
:focus-visible { outline: 3px solid #c58d31; outline-offset: 3px; }
p { line-height: 1.78; margin: 12px 0; }
h1, h2, h3 { line-height: 1.4; margin: 0; }
h2 { color: var(--navy); font-size: 1.25rem; margin-bottom: 14px; }
h3 { font-size: 1.02rem; }
strong { font-weight: 750; }
.skip { position: fixed; left: 10px; top: -90px; z-index: 200; padding: 12px; background: white; }
.skip:focus { top: 8px; }
.language-row { max-width: 1480px; margin: auto; padding: 8px 56px; display: flex; justify-content: space-between; gap: 14px; align-items: center; min-height: 52px; position: sticky; top: 0; z-index: 30; background: var(--background); }
.language-row > a { font-size: .87rem; font-weight: 700; }
.language-control { display: flex; gap: 8px; flex-shrink: 0; }
.language-control button { border-radius: 999px; min-height: 34px; padding: 5px 14px; font-size: .82rem; border-color: #7e8998; }
.language-control [aria-pressed="true"] { background: var(--navy); color: white; border-color: var(--navy); }
.hero { color: white; background: linear-gradient(118deg,var(--navy),var(--navy-light)); }
.hero-inner { width: min(100%,1480px); margin: auto; padding: 27px 56px 32px; }
.hero h1 { font-family: YuMincho,"Yu Mincho",Georgia,serif; font-size: clamp(2rem,4.1vw,3.45rem); font-weight: 700; line-height: 1.24; letter-spacing: .015em; text-wrap: balance; }
.edition { margin: 0 0 10px; color: #e8e7df; font-size: .86rem; font-weight: 700; letter-spacing: .04em; }
.category-nav { background: var(--paper); border-bottom: 1px solid #aeb8c7; overflow-x: auto; }
.category-nav > div { display: flex; gap: 26px; width: max-content; min-width: min(100%,1480px); margin: auto; padding: 10px 56px; }
.category-nav a { min-height: 32px; display: inline-flex; align-items: center; color: var(--link); text-decoration: none; font-weight: 750; white-space: nowrap; border-bottom: 2px solid transparent; }
.category-nav [aria-current="page"] { color: var(--navy); border-color: var(--gold); }
.utility { width: min(100%,1440px); margin: auto; padding: 14px 56px; display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.current-category { color: var(--gold); font-size: .9rem; }
.utility-buttons { display: flex; gap: 8px; }
.shell { max-width: 1440px; margin: 0 auto; padding: 12px 56px 0; }
.notice { padding: 12px 18px; background: #f4eddc; border: 1px solid var(--line); border-radius: 12px; margin: 0 0 24px; }
.notice p { margin: 0; font-size: .95rem; }
.notice.warning { background: #f9eee7; border-color: #b57d66; }
.search-panel { padding: 16px 20px; border: 1px solid #b6bfca; background: #f9f8f2; border-radius: 12px; margin-bottom: 28px; }
.search-panel label { display: block; font-weight: 700; font-size: .88rem; margin-bottom: 8px; }
.search-line { display: flex; gap: 10px; align-items: stretch; }
#search-clear { flex-shrink: 0; min-width: 68px; white-space: nowrap; }
#search { width: 100%; min-width: 0; border: 1px solid #8999ad; border-radius: 7px; padding: 10px 12px; background: white; }
#search-status { color: var(--muted); font-size: .88rem; margin-top: 8px; }
#search-status:empty { display: none; }
#search-results { margin: 12px 0 0; padding-left: 22px; }
#search-results:empty { display: none; }
#search-results li { padding: 12px 2px; border-bottom: 1px solid #d4d8dd; }
#search-results a { font-weight: 700; }
.search-category { color: var(--gold); font-size: .8rem; display: block; }
.search-context { margin: 4px 0 0; color: #4c5867; font-size: .88rem; line-height: 1.6; }
.layout { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 34px; align-items: start; }
.toc { background: var(--paper); border: 1px solid #a99a81; border-radius: 17px; padding: 20px 16px; position: sticky; top: 72px; max-height: calc(100dvh - 160px); overflow: auto; }
.route-card,.section,.chapter { scroll-margin-top: 70px; }
.toc h2 { font-size: .86rem; color: var(--gold); letter-spacing: .08em; margin: 0 8px 12px; }
.toc a { display: block; padding: 8px; font-size: .87rem; text-decoration: none; color: #455367; line-height: 1.5; border-radius: 5px; }
.toc a:hover { background: #f4eddf; color: var(--navy); }
main { min-width: 0; }
.progress-panel { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 20px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 17px; background: #fbf8f0; margin-bottom: 24px; }
.progress-panel h2 { font-size: 1rem; margin: 0; }
.progress-panel p { font-size: .87rem; color: var(--muted); margin: 8px 0 14px; }
.progress-actions { min-width: 136px; display: flex; flex-direction: column; gap: 12px; align-items: flex-end; justify-content: center; }
.progress-count { color: var(--gold); font-size: 1.25rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.progress-actions button { font-size: .87rem; }
.meter { height: 10px; border: 1px solid #b5a17e; border-radius: 999px; background: #eae4d7; overflow: hidden; }
.meter-fill { display: block; height: 100%; width: 0; background: var(--green); transition: width .35s ease; }
.storage-status { margin-bottom: 20px; background: #fff3df; border: 1px solid #a67423; padding: 14px; border-radius: 10px; font-size: .9rem; }
.storage-status button { margin: 10px 0 0; display: block; }
.section { padding: 22px 24px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; margin-bottom: 25px; }
.section:has(.route-card) { padding: 0; background: transparent; border: 0; }
.section > p:first-of-type { margin-top: 0; }
.chapter { margin: 0 0 24px; }
.chapter > summary { cursor: pointer; padding: 17px 20px; background: var(--paper); border: 1px solid #ad9b7c; border-radius: 12px; font-weight: 750; color: var(--navy); list-style-position: inside; }
.chapter[open] > summary { background: #f7f1e3; }
.chapter-body { padding: 5px 0 0; }
.chapter-body > p { margin: 15px 8px; font-size: .95rem; }
.route-card { position: relative; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); margin: 14px 0; box-shadow: 0 5px 14px #42331f0c; }
.step-title { display: grid; grid-template-columns: 25px minmax(0,1fr); gap: 14px; align-items: start; }
.step-title h3 { padding-top: 1px; }
.step-title label { cursor: pointer; }
.check { width: 24px; height: 24px; margin: 1px 0; accent-color: #087653; cursor: pointer; flex-shrink: 0; }
.step-content { padding-left: 39px; }
.step-content p { margin: 10px 0 7px; }
.route-card.is-complete { border-color: var(--green); padding-bottom: 58px; box-shadow: 0 5px 15px #23785814; }
.stamp { display: none; }
.is-complete > .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); font-size: .92rem; font-weight: 850; letter-spacing: .1em; line-height: 1; transform: none; background: radial-gradient(circle at 18% 30%,#fffef9e8 0 1px,transparent 1.4px) 0 0 / 9px 8px,#fffef9; box-shadow: inset 0 0 0 1px #b3332f29; }
.just-completed { animation: card-bump .58s ease; }
.just-completed > .stamp { animation: stamp-in .58s ease; }
@keyframes card-bump { 0%,100% { transform: scale(1); } 35% { transform: scale(1.012); } 65% { transform: scale(.997); } }
@keyframes stamp-in { 0% { opacity: 0; transform: scale(1.35); } 60% { opacity: 1; transform: scale(.94); } 100% { transform: scale(1); } }
.mode { display: inline-block; margin: 8px 0 0; padding: 5px 9px; border: 1px solid #a8acb0; border-radius: 6px; font-size: .85rem; font-weight: 700; line-height: 1.55; }
.mode-g { color: #175d45; border-color: #8db8a5; background: #eaf4ee; }
.mode-r { color: #8d302b; border-color: #d2a09a; background: #fbefeb; }
.mode-n { color: #4a5263; border-color: #b1b8c2; background: #f0f2f4; }
.mode-s,.mode-h { color: #795318; border-color: #c6b28a; background: #f8f0dd; }
.chart-tools { display: flex; gap: 10px; flex-wrap: wrap; margin: 26px 0 15px; }
.table-wrap { max-width: 100%; overflow: auto; margin: 16px 0; border-radius: 9px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; line-height: 1.6; font-size: .9rem; background: white; }
th { background: #233f64; color: white; text-align: left; padding: 11px 12px; font-weight: 700; vertical-align: top; }
td { padding: 12px; vertical-align: top; border-bottom: 1px solid #ccd2d9; }
th+th, td+td { border-left: 1px solid #d3d9df; }
tbody tr:nth-child(even) { background: #eff3f6; }
td:first-child { min-width: 48px; }
.comparison table { min-width: 720px; }
.comparison th:nth-child(1) { width: 70px; }
.comparison th:nth-child(2) { width: 210px; }
.comparison th:nth-child(3),.comparison th:nth-child(4) { width: 220px; }
.cell-check { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.cell-check a { font-size: .82rem; }
.faq { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; margin: 12px 0; }
.faq summary { cursor: pointer; padding: 15px 16px; font-weight: 750; }
.faq p { margin: 0; padding: 0 18px 18px; }
footer { text-align: center; padding: 34px 0 38px; margin-top: 15px; }
footer a { font-weight: 750; }
.bottom-space { position: fixed; bottom: 0; left: 0; right: 0; height: 64px; background: #eee9de; border-top: 1px solid #c9beac; }
#back-top { position: fixed; right: 18px; bottom: 9px; width: 46px; height: 46px; padding: 0; display: grid; place-items: center; border: 1px solid #7e8998; border-radius: 50%; color: var(--navy); background: var(--paper); box-shadow: 0 5px 16px #17213222; font-weight: 850; font-size: 1.15rem; z-index: 20; }
[hidden] { display: none !important; }
@media (max-width: 1000px) {
  .shell,.language-row,.utility { padding-left: 28px; padding-right: 28px; }
  .hero-inner { padding-left: 28px; padding-right: 28px; }
  .category-nav > div { padding-left: 28px; padding-right: 28px; }
  .layout { grid-template-columns: 210px minmax(0,1fr); gap: 24px; }
  .progress-panel { grid-template-columns: 1fr; }
  .progress-actions { flex-direction: row; justify-content: space-between; align-items: center; }
}
@media (max-width: 760px) {
  .language-row { padding: 9px 14px; gap: 8px; }
  .language-row > a { font-size: .76rem; }
  .language-control { gap: 5px; }
  .language-control button { padding: 5px 10px; font-size: .75rem; }
  .hero-inner { padding: 24px 20px 27px; }
  .hero h1 { font-size: clamp(1.65rem,7vw,2.15rem); line-height: 1.3; }
  .edition { font-size: .76rem; margin-bottom: 10px; }
  .category-nav > div { padding: 8px 20px; gap: 22px; }
  .category-nav a { font-size: .86rem; }
  .utility { padding: 12px 15px; gap: 10px; }
  .utility button { padding: 7px 12px; min-height: 40px; font-size: .85rem; }
  .current-category { font-size: .78rem; }
  .shell { padding: 8px 14px 0; }
  .notice { padding: 13px 15px; margin-bottom: 18px; border-radius: 11px; }
  .notice p { font-size: .87rem; }
  .search-panel { padding: 14px; margin-bottom: 20px; }
  .search-line { gap: 6px; }
  #search { font-size: 16px; padding: 9px; }
  #search-clear { padding: 8px 10px; font-size: .83rem; }
  .layout { display: flex; flex-direction: column; gap: 22px; }
  .toc { display: grid; grid-template-columns: 1fr 1fr; width: 100%; padding: 15px 12px; position: static; max-height: none; border-radius: 14px; }
  .toc h2 { grid-column: 1 / -1; }
  .toc a { font-size: .79rem; padding: 7px 8px; }
  main { width: 100%; }
  .progress-panel { padding: 18px; border-radius: 14px; gap: 14px; }
  .progress-count { font-size: 1.1rem; }
  .section { padding: 19px 17px; border-radius: 13px; }
  h2 { font-size: 1.15rem; }
  .route-card { padding: 17px 15px; }
  .step-title { gap: 11px; }
  .step-content { padding-left: 0; }
  .step-content p { line-height: 1.78; }
  .chapter > summary { padding: 16px; font-size: .95rem; }
  .chart-tools button { font-size: .85rem; padding: 8px 12px; }
  .table-wrap:not(.comparison) table { min-width: 530px; }
  .table-wrap th,.table-wrap td { padding: 10px; }
  .mode { font-size: .82rem; }
  .is-complete > .stamp { right: 14px; }
}
.cell-check.route-card,.cell-check.route-card.is-complete { display: flex; gap: 12px; align-items: center; min-height: 28px; margin: 12px 0 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.cell-check.route-card.is-complete > .stamp { position: static; display: grid; width: 48px; height: 25px; flex: 0 0 48px; font-size: .75rem; }
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  html,body { overflow: visible !important; height: auto !important; background: white; }
  #page-scroll { overflow: visible !important; height: auto !important; }
  .language-row,.category-nav,.utility,.search-panel,.toc,.chart-tools,.bottom-space,#back-top,.progress-actions button,footer,.skip { display: none !important; }
  .shell { max-width: none; padding: 0; }
  .hero { background: white; color: black; }
  .hero-inner { padding: 10px 0 20px; }
  .hero h1 { font-size: 25pt; }
  .edition { color: black; }
  .layout { display: block; }
  .table-wrap { overflow: visible; }
  .table-wrap table { min-width: 0 !important; width: 100% !important; table-layout: auto !important; font-size: 9pt; }
  .table-wrap th { width: auto !important; }
  th { background: #e5e5e5; color: black; }
  .route-card { box-shadow: none; break-inside: avoid; }
  .stamp { print-color-adjust: exact; }
  .chapter { break-inside: auto; }
}

.command-table table { min-width: 890px; width: 890px; table-layout: fixed; }
.command-table th:nth-child(1) { width: 170px; }
.command-table th:nth-child(2) { width: 180px; }
.command-table th:nth-child(3) { width: 320px; }
.command-table th:nth-child(4) { width: 220px; }
@media print { .command-table table { min-width: 0; width: 100%; table-layout: auto; } .command-table th { width: auto; } }

.mini-command-table table { min-width: 550px; width: 550px; table-layout: fixed; }
.mini-command-table th:nth-child(1) { width: 50px; }
.mini-command-table th:nth-child(2) { width: 180px; }
.mini-command-table th:nth-child(3) { width: 320px; }
@media print { .mini-command-table table { min-width: 0; width: 100%; table-layout: auto; } .mini-command-table th { width: auto; } }

.comparison.items-table table { min-width: 800px; width: 100%; table-layout: fixed; }
.comparison.items-table th:nth-child(1) { width: 20%; }
.comparison.items-table th:nth-child(2),.comparison.items-table th:nth-child(3) { width: 40%; }
