:root {
  color-scheme: light;
  --ink: #172a33;
  --muted: #4d636e;
  --navy: #163845;
  --accent: #00695b;
  --edge: #c9d9dc;
  --wash: #eff6f4;
  --paper: #fff;
  --reading: 47rem;
  --width: 78rem;
  --sticky: 5.5rem;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.75;
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
html { scroll-padding-top: var(--sticky); }
[id] { scroll-margin-top: .6rem; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: .15em; }
:focus-visible { outline: 3px solid #00695b; outline-offset: 4px; }
button, select, input, textarea { font: inherit; }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.4; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.8rem, 4.1vw, 3rem); letter-spacing: .015em; margin-block: 0 1.35rem; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-block: 0 1rem; }
h3 { font-size: 1.32rem; margin-top: 2rem; }
h4 { font-size: 1.08rem; }
p { margin-block: .7em 1em; }
ul, ol { padding-inline-start: 1.55em; }
li + li { margin-top: .35rem; }
code { font-family: "IBM Plex Mono", Consolas, monospace; overflow-wrap: anywhere; }
pre { padding: 1rem; background: var(--wash); overflow: auto; line-height: 1.55; }
blockquote { margin: 1rem 0; padding: .75rem 1rem; border-inline-start: 3px solid var(--accent); background: var(--wash); }
hr { border: 0; border-top: 1px solid var(--edge); margin-block: 2rem; }

.header { background: var(--paper); border-bottom: 1px solid var(--edge); z-index: 2; }
.home .header { position: sticky; top: 0; }
.header-inner, .footer-inner, main { width: min(calc(100% - 3rem), var(--width)); margin: auto; }
.header-inner { min-height: 4.6rem; display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; }
.wordmark { color: var(--navy); font: 700 1.65rem/1.2 Inter, "Segoe UI", sans-serif; letter-spacing: -.055em; text-decoration: none; }
.header nav, .footer nav { display: flex; gap: .55rem 1.4rem; flex-wrap: wrap; }
.header nav a { color: var(--navy); text-decoration: none; font-weight: 700; white-space: nowrap; font-size: .87rem; }
.header nav a:hover { text-decoration: underline; }
main { padding-block: clamp(2rem, 5vw, 4rem) 4rem; min-height: 60vh; }
.home main { padding-top: 0; }
.footer { border-top: 1px solid var(--edge); background: var(--wash); padding: 2rem 0 1.5rem; }
.footer p, .note { color: var(--muted); font-size: .87rem; }

.section { padding: clamp(2.2rem, 5.5vw, 4.2rem) 0; border-bottom: 1px solid var(--edge); }
.section:last-child { border: 0; }
.prose { max-width: var(--reading); overflow-wrap: anywhere; }
.hero { padding: clamp(2rem, 6vw, 5rem) clamp(1.2rem, 5vw, 4.5rem); background: var(--wash); border-inline-start: 5px solid var(--accent); }
.hero .prose { max-width: 59rem; }
.hero h1 { text-wrap: balance; }
.hero .prose p { max-width: 43rem; }
.facts ul { display: grid; grid-template-columns: repeat(3, 1fr); list-style: none; gap: .7rem; padding: 0; margin-block: 1.8rem 1rem; }
.facts li { margin: 0; background: var(--paper); border: 1px solid var(--edge); border-radius: .35rem; padding: .75rem 1rem; font-weight: 700; text-wrap: balance; }
.hero-note { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.button, button { display: inline-block; border: 1px solid var(--accent); border-radius: .3rem; padding: .45rem 1rem; background: var(--paper); color: var(--accent); font-weight: 700; text-decoration: none; }
.button:hover { background: var(--wash); }
.button.primary { color: white; background: var(--accent); }
.button.primary:hover { background: #005247; }

.version { display: inline-block; margin: 1.4rem 0 .5rem; color: var(--navy); font-weight: 700; }
details { border: 1px solid var(--edge); border-radius: .35rem; margin-block: .65rem; }
summary { cursor: pointer; padding: .8rem 1rem; background: var(--wash); color: var(--navy); font-weight: 700; overflow-wrap: anywhere; }
summary small { margin-inline-start: .9em; color: var(--muted); font-weight: 400; }
.panel { padding: .75rem clamp(.7rem, 2vw, 1.25rem) 1.15rem; min-width: 0; }
.panel > .prose > :first-child { margin-top: .5rem; }
.question { border-top: 1px solid var(--edge); padding-block: .35rem; }
.question h4 { margin-bottom: .8rem; }
.comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-block: 1.35rem; }
.comparison > div { border: 1px solid var(--edge); padding: .8rem; border-radius: .35rem; min-width: 0; }
.comparison > div > h4 { margin: 0; }
#version-diff { margin-top: 2rem; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; margin-block: .9rem; overflow-wrap: anywhere; }
th, td { text-align: start; vertical-align: top; border: 1px solid var(--edge); padding: .55rem .65rem; }
thead th { background: #e6efef; color: var(--navy); }
tbody tr:nth-child(even) { background: #f7faf9; }
.boundary-scroll { overflow-x: auto; }
.boundary-table { min-width: 55rem; line-height: 1.55; }
.boundary-table tbody th { white-space: nowrap; color: var(--navy); }
.boundary-table td:last-child a { white-space: nowrap; }
.comparison .boundary-table { min-width: 0; table-layout: fixed; font-size: .77rem; }
.comparison .boundary-table th, .comparison .boundary-table td { padding: .4rem; }
.comparison .boundary-table th:first-child { width: 2.5rem; }
.changed-row > * { background: #fff7df; }
.changed-row > .changed-cell { background: #f8e1a6; box-shadow: inset 0 2px #8b6111; }
.mobile-label { display: none; }
tr:target > *, section.question:target { background: #e4f4ee; }

.preview-form { margin-top: 1.5rem; padding: clamp(.85rem, 3vw, 1.5rem); border: 1px solid var(--edge); border-radius: .35rem; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.field { display: grid; gap: .4rem; margin-bottom: 1rem; font-weight: 700; }
.field small { color: var(--muted); background: var(--wash); border-radius: .2rem; padding: .1rem .35rem; }
.field input:not([type="radio"]), .field textarea, .field select {
  width: 100%; border: 1px solid var(--edge); border-radius: .3rem; padding: .4rem .55rem;
  background: #f4f7f7; color: var(--muted); opacity: 1;
}
.choice label, .field-help { font-size: .9rem; font-weight: 400; }
.field-help { color: var(--muted); }
.notice { border-inline-start: 3px solid var(--accent); background: var(--wash); padding: .65rem .8rem; }
button:disabled { color: var(--muted); background: #edf1f2; border-color: var(--edge); }
.articles { padding: 0; list-style: none; max-width: var(--reading); }
.articles li, .operator div { border-top: 1px solid var(--edge); padding-block: 1rem; }
.articles h2 { font-size: 1.25rem; margin: 0; }
.operator div { display: grid; grid-template-columns: 8.5rem 1fr; gap: .6rem; }
.operator dt { font-weight: 700; color: var(--navy); }
.operator dd { margin: 0; }

@media (max-width: 57rem) {
  .comparison { grid-template-columns: 1fr; }
  .boundary-table, .comparison .boundary-table { min-width: 0; font-size: .9rem; }
  .boundary-table thead { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
  .boundary-table, .boundary-table tbody, .boundary-table tr, .boundary-table :is(th, td) { display: block; }
  .boundary-table tr { border: 1px solid var(--edge); margin-bottom: .75rem; }
  .boundary-table tbody :is(td, th) { border: 0; padding: .45rem .65rem; width: auto; }
  .boundary-table tbody :is(td, th) + td { border-top: 1px solid var(--edge); }
  .mobile-label { display: block; font-size: .78rem; font-weight: 700; color: var(--muted); }
}

@media (max-width: 40rem) {
  :root { --sticky: 6.3rem; }
  .header-inner, .footer-inner, main { width: calc(100% - 1.5rem); }
  .header-inner { flex-direction: column; align-items: flex-start; gap: .5rem; padding-block: .65rem; }
  .header nav { width: 100%; justify-content: space-between; gap: .35rem; }
  .header nav a { font-size: .79rem; }
  .facts ul { grid-template-columns: 1fr; gap: .35rem; }
  .facts li { padding: .45rem .65rem; }
  .operator div { grid-template-columns: 1fr; gap: .15rem; }
}
