:root {
  color-scheme: light;
  --font-scale: 1;
  --ink: #1f3028;
  --muted: #687a70;
  --line: #c9ddd1;
  --line-strong: #91b5a1;
  --canvas: #eff7f2;
  --panel: #ffffff;
  --forest: #4f8e6c;
  --forest-dark: #2f6c4d;
  --forest-deep: #24543c;
  --forest-soft: #e8f5ed;
  --menu: #f7faf8;
  font-family: "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  font-size: calc(100% * var(--font-scale));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); line-height: 1.7; }
a { color: #256446; text-underline-offset: 2px; }
button, input, select { font: inherit; }

.display-preferences { position: sticky; top: 0; z-index: 40; color: var(--ink); background: #f7fbf8; border-bottom: 1px solid var(--line); }
.display-preferences-inner { max-width: 1560px; margin: 0 auto; padding: .5rem 1.25rem; display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1.5rem; }
.display-preference { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .65rem; }
.display-preference label { font-size: .9rem; font-weight: 700; }
.display-preference select { min-height: 2.5rem; max-width: 100%; padding: .35rem .6rem; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: .3rem; }
.display-preference select:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid #7ac69a; outline-offset: 2px; }

.site-header { position: sticky; top: var(--preferences-height, 0); z-index: 30; color: #fff; background: linear-gradient(110deg, var(--forest-deep), var(--forest)); border-bottom: 3px solid #1d4933; box-shadow: 0 4px 14px rgb(28 77 51 / 16%); }
.header-inner { max-width: 1560px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 18px; }
.brand { color: #fff; text-decoration: none; font-weight: 800; letter-spacing: .04em; overflow-wrap: anywhere; }
.menu-button { display: none; flex: 0 0 auto; min-width: 44px; min-height: 44px; margin-left: auto; padding: 5px 10px; color: #fff; background: transparent; border: 1px solid rgb(255 255 255 / 70%); border-radius: 6px; white-space: nowrap; }

.site-shell { width: min(1560px, 100%); min-height: calc(100vh - 58px); margin: 0 auto; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.sidebar { position: sticky; top: calc(var(--preferences-height, 0px) + var(--header-height, 58px)); align-self: start; height: calc(100vh - var(--preferences-height, 0px) - var(--header-height, 58px)); overflow-y: auto; padding: 18px 14px 28px; background: var(--menu); border-right: 1px solid var(--line); }
.nav-group { margin: 0 0 8px; background: #fff; border: 1px solid var(--line); }
.nav-group summary { cursor: pointer; padding: 8px 10px; font-weight: 800; background: #e6eee9; list-style: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::before { content: "＋"; display: inline-block; width: 1.5em; color: var(--forest-dark); }
.nav-group[open] summary::before { content: "−"; }
.nav-links { margin: 0; padding: 7px 8px 9px 30px; }
.nav-links li { margin: 3px 0; }
.nav-placeholder { color: var(--muted); font-size: .86rem; }

.page-search { margin: 0 0 12px; padding: 12px; background: #f8fbf9; border: 1px solid var(--line); border-radius: 7px; }
.page-search label { display: block; margin-bottom: 7px; font-size: .8rem; font-weight: 800; }
.search-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.search-controls input { min-width: 0; padding: 7px 9px; background: #fff; border: 1px solid var(--line-strong); border-radius: 6px; }
.search-controls button { color: #fff; background: var(--forest-dark); border: 0; border-radius: 6px; padding: 7px 10px; font-weight: 800; }
.search-status { min-height: 1.3em; margin: 5px 0 0; color: var(--muted); font-size: .76rem; }

.content { min-width: 0; padding: 24px clamp(16px, 3vw, 44px) 56px; }
.page-card { min-width: 0; max-width: 100%; padding: clamp(18px, 3vw, 36px); background: var(--panel); border: 1px solid var(--line); box-shadow: 0 8px 24px rgb(31 58 43 / 7%); }
.page-card > :first-child { margin-top: 0; }
h1, h2 { line-height: 1.35; color: #1d3227; }
h1 { margin: 0 0 22px; padding-bottom: 9px; border-bottom: 3px solid var(--forest); font-size: clamp(1.55rem, 3vw, 2rem); }
h2 { margin-top: 30px; padding: 7px 10px; background: #e4efe8; border-left: 5px solid var(--forest); font-size: 1.18rem; }
.top-intro { font-size: 1.03rem; }

.preparation-panel { margin: 18px 0 28px; padding: 16px; text-align: center; background: #f7fbf8; border: 1px solid var(--line); border-radius: 12px; }
.preparation-panel h2 { margin: 0 0 14px; padding: 6px 10px; border-left: 0; background: #e3eee7; color: var(--forest-deep); }
.preparation-panel p { margin: 7px 0; }
.important-notes { margin-bottom: 30px; }

.home-menu-group { margin: 0 0 12px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.home-menu-group summary { cursor: pointer; padding: 13px 18px; color: #294f3a; background: var(--forest-soft); font-weight: 800; list-style: none; }
.home-menu-group summary::-webkit-details-marker { display: none; }
.home-menu-group summary::before { content: "＋"; display: inline-block; width: 1.6em; color: var(--forest); }
.home-menu-group[open] summary::before { content: "−"; }
.home-menu-group p { margin: 0; padding: 12px 22px 14px 48px; color: var(--muted); }
.search-hit { animation: search-flash 1.6s ease-out; }
@keyframes search-flash { 0%, 35% { background-color: #fff3ad; } 100% { background-color: transparent; } }

.site-footer { padding: 26px 20px 34px; color: #61766a; background: #e8f3ec; border-top: 1px solid var(--line); font-size: .78rem; text-align: center; }
.site-footer p { margin: 3px 0; }
.site-footer a { color: var(--forest-dark); font-weight: 700; }
.site-contact { width: min(420px, 100%); margin: 8px auto 0; }
.site-contact summary { cursor: pointer; color: var(--forest-dark); font-weight: 800; }

@media (max-width: 900px) {
  .display-preferences-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; gap: .25rem .45rem; padding: .35rem .5rem; }
  .display-preference { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: .15rem; }
  .display-preference label { display: none; }
  .display-preference select { width: 100%; min-width: 0; min-height: 44px; height: 44px; padding: .1rem .3rem; font-size: .75rem; }
  .header-inner { padding: 10px 12px; }
  .brand { font-size: .88rem; }
  .menu-button { display: inline-block; }
  .site-shell { display: block; }
  .sidebar { display: none; position: fixed; inset: calc(var(--preferences-height, 0px) + var(--header-height, 58px)) 0 0; z-index: 25; height: auto; padding: 14px; border-right: 0; }
  .sidebar.is-open { display: block; }
  .content { padding: 14px 10px 40px; }
  .page-card { padding: 16px 12px 28px; }
}

@media (max-width: 380px) {
  .brand { max-width: 210px; font-size: .78rem; line-height: 1.35; }
}
