:root {
  --ink: #172126; --muted: #5b6870; --line: #d9e1e5; --paper: #fff;
  --wash: #f4f7f8; --navy: #12384a; --blue: #12688a; --blue-soft: #e8f4f8;
  --focus: #f0a100; --max: 1120px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif; line-height: 1.75; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 1000; top: 8px; left: 8px; padding: .7rem 1rem; background: #fff; color: var(--navy); transform: translateY(-150%); }
.skip-link:focus { transform: none; }
a { color: var(--blue); text-underline-offset: .18em; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.site-header { border-bottom: 1px solid var(--line); background: #fff; }
.site-header__inner { max-width: var(--max); margin: auto; padding: 1.2rem 1.5rem; display: grid; grid-template-columns: auto minmax(0,1fr) minmax(270px,360px); align-items: center; gap: 1.5rem; }
.brand { color: var(--navy); font-family: serif; font-size: 1.65rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.site-header__description { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.55; }
.header-search { display: flex; width: 100%; }
.header-search input { min-width: 0; flex: 1; border: 1px solid #9aabb3; border-radius: 6px 0 0 6px; padding: .7rem .8rem; font-size: 1rem; }
.header-search button { border: 0; border-radius: 0 6px 6px 0; padding: .7rem 1rem; color: #fff; background: var(--navy); font-weight: 700; }
.law-switcher { display: flex; gap: .35rem; max-width: var(--max); margin: auto; padding: 0 1.5rem; overflow-x: auto; }
.law-switcher a, .law-switcher span { padding: .75rem 1rem; white-space: nowrap; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; }
.law-switcher .is-current { color: var(--navy); font-weight: 700; border-color: var(--blue); }
.law-switcher span[aria-disabled=true] { color: #7f8a90; }
.law-switcher small { font-size: .68rem; }
.site-main { max-width: var(--max); margin: auto; padding: 2.5rem 1.5rem 5rem; }
.page-with-sidebar { display: grid; grid-template-columns: 250px minmax(0,var(--max)); align-items: start; width: min(100%,calc(var(--max) + 250px)); margin: auto; }
.page-with-sidebar .site-main { width: 100%; max-width: none; margin: 0; }
.chapter-sidebar { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; margin-top: 2.5rem; padding: .4rem 0 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--wash); }
.chapter-sidebar__header { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1.25rem; color: var(--navy); border-bottom: 1px solid var(--line); font-size: 1.08rem; }
.chapter-sidebar__close { display: none; width: 2.5rem; height: 2.5rem; border: 0; border-radius: 50%; color: var(--navy); background: #fff; font-size: 1.5rem; cursor: pointer; }
.chapter-sidebar ul { margin: 0; padding: .35rem 0; list-style: none; }
.chapter-sidebar__link { display: block; padding: .72rem 1.25rem; border-left: 4px solid transparent; color: var(--ink); font-size: .93rem; font-weight: 700; line-height: 1.45; text-decoration: none; }
.chapter-sidebar__link:hover { color: var(--blue); background: #fff; }
.chapter-sidebar__link.is-current { border-left-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.chapter-sidebar-toggle { display: none; }
.chapter-sidebar-backdrop { display: none; }
.hero { padding: 2.4rem; border-radius: 12px; background: linear-gradient(135deg,#eff7f9,#f8faf9); }
.eyebrow, .article-kicker { margin: 0 0 .25rem; color: var(--blue); font-size: .75rem; font-weight: 800; letter-spacing: .16em; }
.hero h1, .article-header h1 { margin: .1rem 0 .5rem; color: var(--navy); font-family: serif; line-height: 1.3; }
.hero h1 { font-size: clamp(1.75rem,4vw,2.6rem); }
.article-header h1 { font-size: clamp(1.75rem,3.2vw,2.35rem); }
.hero p:last-child { margin-bottom: 0; color: var(--muted); }
.law-effective-date { margin: 0; font-size: 1rem; }
.chapter { scroll-margin-top: 5rem; margin-top: 3rem; }
.chapter summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.chapter summary::marker { content: ""; }
.chapter-title { flex: 1; margin: 0; padding-bottom: .65rem; color: var(--navy); font-family: serif; font-size: clamp(1.75rem,3.2vw,2.2rem); font-weight: 700; border-bottom: 2px solid var(--navy); }
.chapter summary > span:last-child { padding-left: 1rem; color: var(--muted); font-size: .8rem; }
.article-list, .search-results { margin: 0; padding: 0; list-style: none; }
.article-list li { border-bottom: 1px solid var(--line); }
.article-list a { display: grid; grid-template-columns: minmax(230px,.8fr) minmax(0,1.5fr); gap: 1.5rem; padding: 1.05rem .6rem; color: inherit; text-decoration: none; }
.article-list a:hover { background: var(--blue-soft); }
.article-number { font-weight: 800; color: var(--blue); }
.article-heading { font-weight: 700; }
.article-overview { color: var(--muted); }
.breadcrumbs { display: flex; gap: .55rem; margin-bottom: 1.5rem; color: var(--muted); font-size: .9rem; }
.article-page { max-width: none; }
.article-header { padding: 1rem 0 2rem; }
.lead { font-size: 1.12rem; color: var(--muted); }
.statute-card { padding: clamp(1.2rem,4vw,2.5rem); border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 8px 30px rgba(18,56,74,.07); }
.article-reading-grid { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,.9fr); gap: 1.5rem; align-items: start; }
.article-reading-grid.article-reading-grid--text-only { display: block; }
.treaty-paragraph { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 1rem; }
.treaty-source { border-top: 1px solid var(--line); margin-top: 1.5rem; padding-top: .75rem; color: var(--muted); font-size: .85rem; }
.treaty-source p, .treaty-source-note { margin: .35rem 0; }
.statute-card, .article-explanation { min-width: 0; overflow-wrap: anywhere; }
.statute-card h2, .article-explanation h2 { margin: 0 0 1.2rem; color: var(--navy); font-size: 1.35rem; }
.article-explanation { position: sticky; top: 1rem; max-height: calc(100dvh - 2rem); overflow-y: auto; padding: 1.5rem; border: 1px solid var(--line); border-radius: 10px; background: var(--wash); }
.article-explanation__section + .article-explanation__section { margin-top: 1.5rem; }
.article-explanation__section h3 { margin: 0 0 .45rem; color: var(--navy); font-size: 1.06rem; }
.article-explanation__section p { margin: 0 0 .65rem; }
.term-explanation { scroll-margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .9rem; margin-top: .9rem; }
.term-explanation h4 { margin: 0 0 .35rem; color: var(--navy); font-size: 1rem; }
.term-explanation:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.statute-text { font-family: serif; font-size: 1.08rem; line-height: 2.05; }
.statute-text p { margin: 0; }
.statute-text .statute-paragraph + .statute-paragraph { margin-top: 1rem; }
.statute-text .statute-item { display: grid; grid-template-columns: 1.4em minmax(0,1fr); column-gap: .35em; align-items: start; margin-top: 1rem; }
.statute-item__number { display: block; font-weight: 700; }
.statute-item__body { min-width: 0; }
.annotation-trigger { display: inline; padding: .08em .14em; border: 0; border-bottom: 2px dotted var(--blue); color: #075b7c; background: var(--blue-soft); font: inherit; cursor: pointer; }
.explanation-dialog { width: min(560px,calc(100% - 2rem)); height: 100dvh; max-height: none; margin: 0 0 0 auto; padding: 2rem; border: 0; border-radius: 12px 0 0 12px; box-shadow: 0 20px 80px rgba(0,0,0,.25); }
.explanation-dialog::backdrop { background: rgba(10,25,33,.58); }
.explanation-dialog h2 { padding-right: 2rem; color: var(--navy); }
.dialog-close { position: absolute; top: .8rem; right: .8rem; width: 2.6rem; height: 2.6rem; border: 0; border-radius: 50%; font-size: 1.5rem; background: var(--wash); cursor: pointer; }
.related-articles { margin-top: 2rem; padding: 1rem 1.25rem; background: var(--wash); border-radius: 8px; }
.article-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.article-nav span:last-child { text-align: right; }
.search-results li { border-bottom: 1px solid var(--line); }
.search-results a { display: flex; flex-direction: column; gap: .3rem; padding: 1rem; text-decoration: none; }
.search-results a:hover { background: var(--blue-soft); }
.search-results span { color: var(--muted); }
.search-filter { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin: 1rem 0; padding: 1rem; background: var(--wash); border-radius: 8px; }
.search-filter select, .search-filter button { min-height: 44px; padding: .5rem .7rem; }
.search-result-law { color: var(--blue); font-weight: 800; letter-spacing: .08em; }
.empty-law { margin-top: 2rem; padding: 1rem 1.25rem; border-radius: 8px; background: var(--wash); }
.site-footer { padding: 2.5rem 1.5rem; text-align: center; color: var(--muted); background: var(--wash); }
.site-footer .menu { padding-inline-start: 0; list-style: none; }
.site-footer .menu > li { list-style: none; }
.cjg-contact-form { max-width: 42rem; }
.cjg-contact-form p { display: grid; gap: .45rem; }
.cjg-contact-form input[type="text"], .cjg-contact-form input[type="email"], .cjg-contact-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: .7rem; font: inherit; }
.cjg-contact-form button { justify-self: start; border: 0; border-radius: 6px; background: var(--navy); color: #fff; padding: .7rem 1rem; font: inherit; cursor: pointer; }
.cjg-contact-honeypot { position: absolute !important; left: -9999px !important; }
.cjg-contact-notice { padding: .8rem 1rem; border-left: 4px solid var(--blue); background: var(--blue-soft); }
.cjg-contact-notice.is-error { border-left-color: #b42318; background: #fff4f2; }
@media (max-width: 700px) {
  .site-header__inner { display: block; padding: 1rem; }
  .brand { display: block; margin-bottom: .35rem; font-size: 1.4rem; }
  .site-header__description { margin-bottom: .85rem; font-size: .83rem; }
  .header-search { width: 100%; }
  .law-switcher { padding: 0 .6rem; }
  .law-switcher a { padding-inline: .8rem; }
  .site-main { padding: 1.5rem 1rem 4rem; }
  .hero { padding: 1.5rem 1.2rem; }
  .article-list a { display: block; padding: 1rem .2rem; }
  .article-title, .article-overview { display: block; }
  .article-overview { margin-top: .35rem; font-size: .92rem; }
  .chapter { margin-top: 2rem; }
  .statute-card { margin-inline: -.25rem; }
  .article-nav { grid-template-columns: 1fr 1fr; }
  .article-nav > a { display: none; }
  .explanation-dialog { width: 100%; height: auto; max-height: 85dvh; margin: auto 0 0; padding: 1.25rem; border-radius: 14px 14px 0 0; }
}
@media (min-width: 701px) and (max-width: 1040px) {
  .site-header__inner { grid-template-columns: auto minmax(0,1fr); }
  .header-search { grid-column: 1 / -1; justify-self: end; max-width: 410px; }
}
@media (max-width: 899px) {
  .article-reading-grid { display: block; }
  .article-explanation { display: none; }
}
@media (max-width: 1040px) {
  .page-with-sidebar { display: block; width: 100%; }
  .chapter-sidebar-toggle { position: sticky; z-index: 60; top: .6rem; display: flex; align-items: center; gap: .45rem; margin: 1rem 1rem 0; padding: .65rem .9rem; border: 1px solid var(--line); border-radius: 999px; color: var(--navy); background: #fff; box-shadow: 0 4px 18px rgba(18,56,74,.12); font: inherit; font-weight: 700; cursor: pointer; }
  .chapter-sidebar { position: fixed; z-index: 1100; top: 0; left: 0; width: min(310px,86vw); height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0 12px 12px 0; box-shadow: 12px 0 36px rgba(10,25,33,.22); transform: translateX(-105%); transition: transform .22s ease; }
  .chapter-sidebar__header { position: sticky; top: 0; z-index: 1; padding: 1rem 1.25rem; background: var(--wash); }
  .chapter-sidebar__close { display: grid; place-items: center; }
  .chapter-sidebar-backdrop { position: fixed; z-index: 1090; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: rgba(10,25,33,.5); opacity: 0; pointer-events: none; transition: opacity .22s ease; }
  body.chapter-sidebar-open { overflow: hidden; }
  body.chapter-sidebar-open .chapter-sidebar { transform: translateX(0); }
  body.chapter-sidebar-open .chapter-sidebar-backdrop { display: block; opacity: 1; pointer-events: auto; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Article reference layout: keep the Excel-backed content and its three sections intact. */
:root {
  --ink: #14233b; --muted: #52627a; --line: #dce4ef;
  --wash: #f7f9fc; --navy: #102348; --blue: #1265c4;
  --blue-soft: #ebf4ff; --max: 1300px;
}
.site-header { box-shadow: 0 1px 5px rgba(20,35,59,.04); }
.site-header__inner { max-width: 1550px; padding-block: .9rem; }
.brand { font-family: inherit; font-size: 1.48rem; letter-spacing: .01em; }
.site-header__description { max-width: 28rem; }
.header-search input { border-color: #b9c9dd; background: #f8fafd; }
.header-search button { background: var(--blue); cursor: pointer; }
.law-switcher { max-width: 1550px; padding-bottom: .45rem; }
.law-switcher a { padding: .45rem .95rem; border: 1px solid var(--line); border-radius: 7px; background: #f6f8fc; font-weight: 600; }
.law-switcher a.is-current { color: #fff; border-color: var(--blue); background: var(--blue); }
.law-switcher a:hover:not(.is-current) { background: var(--blue-soft); }
.page-with-sidebar { grid-template-columns: 240px minmax(0,var(--max)); width: min(100%,calc(var(--max) + 240px)); }
.page-with-sidebar .site-main { min-width: 0; }
.chapter-sidebar { margin-top: 0; border-radius: 0 0 8px 8px; background: #f9fbfe; }
.chapter-sidebar__header { padding: .8rem 1rem; }
.chapter-sidebar__link { padding: .7rem 1rem; }
.chapter-sidebar__articles { margin: 0 0 .65rem !important; padding: 0 .55rem 0 1.1rem !important; }
.chapter-sidebar__article { display: block; padding: .55rem .6rem; border-left: 3px solid transparent; border-radius: 0 6px 6px 0; color: var(--ink); text-decoration: none; font-size: .92rem; line-height: 1.35; }
.chapter-sidebar__article small { display: block; margin-top: .15rem; color: var(--muted); font-size: .78rem; line-height: 1.35; }
.chapter-sidebar__article:hover, .chapter-sidebar__article.is-current { color: var(--blue); background: var(--blue-soft); }
.chapter-sidebar__article.is-current { border-left-color: var(--blue); font-weight: 700; }
.breadcrumbs { flex-wrap: wrap; gap: .35rem .5rem; margin-bottom: 1rem; }
.article-page { padding-top: 1.5rem; }
.article-header { padding: 0 0 1.25rem; }
.article-header h1 { margin: 0; font-family: inherit; font-size: clamp(1.85rem,3vw,2.35rem); line-height: 1.4; }
.article-subtitle { margin: .1rem 0 0; color: var(--muted); font-size: 1.12rem; }
.article-reading-grid { grid-template-columns: minmax(0,1.12fr) minmax(0,.88fr); gap: 1rem; }
.statute-card { padding: 0 1.5rem 1.7rem; border-radius: 8px; box-shadow: 0 2px 12px rgba(20,35,59,.035); }
.statute-card h2, .article-explanation h2 { margin: 0; padding: .85rem 0; font-family: inherit; font-size: 1.2rem; line-height: 1.4; }
.statute-card h2 { margin-bottom: 1.1rem; border-bottom: 1px solid var(--line); }
.statute-card h2::before, .article-explanation h2::before { content: ""; display: inline-block; width: .25rem; height: 1em; margin-right: .65rem; border-radius: 2px; background: var(--blue); vertical-align: -.12em; }
.statute-text { font-size: 1.07rem; line-height: 2; overflow-wrap: break-word; }
.statute-text .statute-item { grid-template-columns: 1.5em minmax(0,1fr); margin-top: .65rem; }
.statute-text .statute-item + .statute-paragraph { margin-top: 1.25rem; }
.statute-text:has(> .statute-paragraph ~ .statute-paragraph) > .statute-paragraph:first-child::before { content: "第１項 "; }
.annotation-trigger { color: #0758ae; border-bottom: 1px solid currentColor; background: #eef5ff; border-radius: 2px; }
.article-explanation { padding: 0; border: 0; background: transparent; }
.article-explanation h2 { margin-bottom: .15rem; }
.article-explanation__section { padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 2px 12px rgba(20,35,59,.035); }
.article-explanation__section + .article-explanation__section { margin-top: .75rem; }
.article-explanation__section h3 { margin-bottom: .55rem; color: #0758ae; font-size: 1.06rem; }
.article-explanation__section h3::before { content: ""; display: inline-block; width: .48rem; height: .48rem; margin-right: .55rem; border: 2px solid var(--blue); border-radius: 50%; vertical-align: .06em; }
.article-explanation__section p:last-child, .article-explanation__section > div > p:last-child { margin-bottom: 0; }
.term-explanation { margin-top: .55rem; padding: .8rem .9rem; border: 1px solid var(--line); border-radius: 7px; background: #fbfdff; }
.term-explanation h4 { color: #0758ae; }
.term-explanation__item + .term-explanation__item { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.term-explanation__item > div { font-size: .94rem; line-height: 1.65; }
.term-explanation__item > div p:last-child { margin-bottom: 0; }
.related-articles { padding: 0; background: transparent; }
.related-articles h2 { margin-bottom: .75rem; font-size: 1.15rem; }
.related-articles ul { display: grid; grid-template-columns: repeat(auto-fit,minmax(185px,1fr)); gap: .65rem; margin: 0; padding: 0; list-style: none; }
.related-articles a { display: block; min-height: 3.2rem; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 7px; color: var(--blue); font-weight: 700; text-decoration: none; background: #fff; }
.related-articles a:hover { background: var(--blue-soft); }
@media (max-width: 899px) {
  .article-reading-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 1rem; }
  .article-explanation { display: block; position: static; max-height: none; overflow: visible; margin-top: 0; }
  .statute-card { margin-inline: 0; }
}
@media (max-width: 700px) {
  .site-header__inner { padding: .8rem 1rem; }
  .brand { margin-bottom: .15rem; font-size: 1.28rem; }
  .site-header__description { margin-bottom: .65rem; font-size: .75rem; }
  .header-search input { padding: .55rem .7rem; }
  .header-search button { padding: .55rem .8rem; }
  .law-switcher { display: grid; grid-template-columns: .85fr 1.35fr .85fr .85fr; gap: .25rem; padding: 0 .75rem .6rem; overflow: visible; }
  .law-switcher a { min-width: 0; padding: .4rem .1rem; font-size: .78rem; text-align: center; }
  .chapter-sidebar-toggle { position: static; margin: .75rem .9rem 0; box-shadow: none; }
  .article-page { padding: 1rem .9rem 3.5rem; }
  .article-header h1 { font-size: 1.8rem; }
  .article-subtitle { font-size: 1rem; }
  .statute-card { padding: 0 .9rem 1.1rem; }
  .statute-card h2, .article-explanation h2 { font-size: 1.08rem; }
  .statute-text { font-size: 1rem; line-height: 1.85; }
  .article-explanation__section { padding: .9rem 1rem; }
  .related-articles ul { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

/* 0.6.0: Standard post and case-study archive presentation. */
.case-page { max-width: 900px; }
.case-header { margin-bottom: 2rem; }
.case-header h1 { font-size: clamp(1.5rem,3vw,2.1rem); line-height: 1.5; color: var(--navy); overflow-wrap: anywhere; }
.case-meta { color: var(--muted); font-size: .85rem; }
.case-content { font-size: 1rem; line-height: 1.95; overflow-wrap: anywhere; }
.case-content p { margin: 1.1rem 0; }
.case-content h2 { margin: 2.6rem 0 1rem; padding: .6rem .8rem; border-left: 4px solid var(--blue); background: var(--wash); font-size: 1.35rem; line-height: 1.6; }
.case-content h3 { margin: 1.7rem 0 .65rem; font-size: 1.12rem; color: var(--navy); }
.case-content table { width: 100%; table-layout: fixed; border-collapse: collapse; margin: 1.5rem 0; font-size: .92rem; line-height: 1.7; }
.case-content th, .case-content td { padding: .75rem; border: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; text-align: left; }
.case-content th { background: var(--blue-soft); font-weight: 700; }
.case-content ul { padding-left: 1.3rem; }
.case-list__item { padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
.case-list__item h2 { font-size: 1.3rem; line-height: 1.6; }
.case-list__item h2 a { text-decoration: none; }
.case-list__item p { color: var(--muted); }
@media (max-width: 600px) {
  .case-page { padding: 1.5rem 1rem 3rem; }
  .case-content table { font-size: .83rem; }
  .case-content th, .case-content td { padding: .45rem; }
  .case-content h2 { font-size: 1.18rem; }
}
