:root {
  --ink: #172033;
  --muted: #64748b;
  --subtle: #94a3b8;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eaf3ff;
  --blue-pale: #f6faff;
  --line: #e3eaf3;
  --green: #15803d;
  --green-soft: #ecfdf3;
  --amber: #a16207;
  --amber-soft: #fff8e7;
  --purple: #6d28d9;
  --navy: #101827;
  --shadow: 0 16px 42px rgba(52, 93, 142, .10);
  --radius: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: #fff; line-height: 1.8; }
body, button, input { font-family: inherit; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
img, svg { max-width: 100%; }
.sr-only { 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: absolute; left: 12px; top: -60px; z-index: 100; padding: 8px 14px; color: #fff; background: var(--blue-dark); border-radius: 0 0 8px 8px; }
.skip-link:focus { top: 0; }
:focus-visible { outline: 3px solid #93c5fd; outline-offset: 3px; }

.wrap { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.narrow { width: min(820px, calc(100% - 48px)); margin: 0 auto; }
.site-header { position: sticky; top: 0; z-index: 30; min-height: 70px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 70px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--blue-dark); font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; color: #fff; background: var(--blue); border-radius: 10px; font-size: 15px; }
.main-nav { display: flex; align-items: center; gap: 4px; font-size: 14px; }
.main-nav a { padding: 8px 11px; color: #506079; border-radius: 8px; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--blue-dark); background: var(--blue-pale); }
.nav-toggle { display: none; padding: 8px 11px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 9px; }

.eyebrow { margin: 0; color: var(--blue); font-size: 13px; font-weight: 800; letter-spacing: .12em; }
.hero { overflow: hidden; padding: 74px 0 66px; background: linear-gradient(115deg, #eff7ff 0%, #f7fbff 58%, #fff 100%); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(330px, .8fr); align-items: center; gap: 56px; }
.hero h1 { max-width: 760px; margin: 13px 0 17px; font-size: clamp(34px, 4.4vw, 54px); line-height: 1.27; letter-spacing: -.045em; }
.hero-lead { max-width: 650px; margin: 0; color: #516078; font-size: 17px; }
.search-box { display: flex; align-items: center; gap: 12px; max-width: 690px; margin-top: 28px; padding: 14px 16px; background: #fff; border: 1px solid #d6e2ef; border-radius: 14px; box-shadow: 0 12px 35px rgba(74, 126, 177, .12); }
.search-box:focus-within { border-color: #8eb8ee; box-shadow: 0 0 0 4px rgba(37, 99, 235, .09); }
.search-icon { color: var(--blue); font-size: 22px; line-height: 1; }
.search-box input { width: 100%; min-width: 0; padding: 2px 0; color: var(--ink); background: transparent; border: 0; outline: 0; font-size: 16px; }
.search-box button { flex: 0 0 auto; padding: 8px 13px; color: #fff; background: var(--blue); border: 0; border-radius: 9px; font-size: 13px; font-weight: 700; }
.search-box button:hover { background: var(--blue-dark); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.chip { padding: 5px 10px; color: #53647a; background: rgba(255,255,255,.78); border: 1px solid #dbe7f4; border-radius: 999px; font-size: 12px; }
.chip:hover { color: var(--blue-dark); border-color: #a9c9ee; }
.search-results { position: relative; z-index: 2; max-width: 690px; }
.search-results:empty { display: none; }
.search-result-list { margin-top: 8px; padding: 7px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.search-result { display: block; padding: 9px 11px; border-radius: 8px; }
.search-result:hover { background: var(--blue-pale); }
.search-result small { display: block; color: var(--muted); font-size: 11px; }
.search-empty { padding: 12px; color: var(--muted); font-size: 13px; }

.hero-visual { position: relative; min-height: 325px; }
.visual-orb { position: absolute; top: 18px; right: 16px; width: 280px; height: 280px; background: #d7eaff; border-radius: 50%; }
.visual-card { position: absolute; display: block; min-width: 175px; padding: 19px 21px; background: #fff; border: 1px solid #d5e3f2; border-radius: 18px; box-shadow: 0 15px 35px rgba(64, 105, 151, .13); }
.visual-card:first-of-type { top: 57px; right: 108px; transform: rotate(-5deg); }
.visual-card:last-of-type { right: 0; bottom: 40px; transform: rotate(5deg); }
.visual-icon { margin-bottom: 5px; font-size: 36px; line-height: 1; }
.visual-card b { display: block; font-size: 16px; }
.visual-card small { color: var(--muted); font-size: 12px; }

.section { padding: 76px 0; }
.section-muted { background: #f8fafc; }
.section-heading { max-width: 720px; margin: 0 auto 34px; text-align: center; }
.section-title { margin: 0 0 7px; font-size: clamp(26px, 3vw, 34px); line-height: 1.35; letter-spacing: -.035em; }
.section-sub { margin: 0; color: var(--muted); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.topic-card { display: block; min-height: 165px; padding: 21px; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.topic-card:hover, .article-card:hover { transform: translateY(-2px); border-color: #b9d3ef; box-shadow: var(--shadow); }
.topic-icon { display: block; font-size: 28px; line-height: 1.1; }
.topic-card h3 { margin: 12px 0 4px; font-size: 16px; }
.topic-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.stage-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.stage-card { display: block; min-height: 126px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.stage-card:hover { border-color: #9fc4eb; box-shadow: var(--shadow); }
.stage-number { color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.stage-card h3 { margin: 8px 0 0; font-size: 15px; line-height: 1.5; }
.stage-card p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.text-link { display: inline-flex; align-items: center; gap: 5px; color: var(--blue-dark); font-weight: 700; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.article-card { display: flex; flex-direction: column; min-height: 250px; padding: 21px; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.article-card .article-meta { margin-bottom: 9px; }
.article-card h2, .article-card h3 { margin: 0 0 8px; font-size: 18px; line-height: 1.45; }
.article-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.article-card .card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 20px; color: var(--subtle); font-size: 12px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; padding: 3px 8px; color: #4e6783; background: #f4f8fc; border: 1px solid #e0eaf4; border-radius: 999px; font-size: 11px; }
.tag-blue { color: var(--blue-dark); background: var(--blue-soft); border-color: #cfe2fb; }
.tag-green { color: var(--green); background: var(--green-soft); border-color: #cbeed7; }
.tag-amber { color: var(--amber); background: var(--amber-soft); border-color: #f6e4ae; }
.callout { padding: 26px; background: var(--blue-pale); border: 1px solid #d7e6f5; border-radius: var(--radius); }
.callout h2, .callout h3 { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }
.split-callout { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.page-hero { padding: 63px 0 52px; background: var(--blue-pale); border-bottom: 1px solid #e8f0f8; }
.page-hero h1 { max-width: 760px; margin: 10px 0 12px; font-size: clamp(32px, 4vw, 46px); line-height: 1.3; letter-spacing: -.04em; }
.page-hero p { max-width: 680px; margin: 0; color: var(--muted); font-size: 16px; }
.page-hero .search-box { margin-top: 25px; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 28px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-button { padding: 7px 11px; color: #52647a; background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.filter-button[aria-pressed="true"], .filter-button:hover { color: var(--blue-dark); background: var(--blue-soft); border-color: #bdd6f2; }
.result-count { color: var(--muted); font-size: 13px; }
.empty-state { padding: 34px; text-align: center; color: var(--muted); background: var(--blue-pale); border-radius: var(--radius); }

.docs-shell { display: grid; grid-template-columns: minmax(0, 1fr) 235px; width: min(1280px, 100%); margin: 0 auto; }
.docs-side { order: 2; padding: 32px 24px 50px 18px; border-left: 1px solid var(--line); font-size: 13px; }
.docs-side:not(.docs-side-right) { display: none; }
.docs-side-right { display: block; }
.side-label { margin: 17px 0 7px; color: var(--subtle); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.side-label:first-child { margin-top: 0; }
.side-link { display: block; padding: 6px 9px; color: #55657a; border-radius: 8px; }
.side-link:hover, .side-link[aria-current="location"] { color: var(--blue-dark); background: var(--blue-soft); font-weight: 700; }
.article-main { min-width: 0; padding: 48px 48px 80px; }
.preview-banner { margin: 0 0 22px; padding: 10px 13px; color: #7c4a03; background: #fff8e7; border: 1px solid #f3dfaa; border-radius: 10px; font-size: 13px; font-weight: 700; }
.breadcrumb { margin: 0 0 9px; color: var(--blue); font-size: 12px; font-weight: 800; }
.article-main h1 { margin: 0 0 15px; font-size: clamp(30px, 4vw, 42px); line-height: 1.3; letter-spacing: -.04em; }
.article-lead { margin: 0; color: var(--muted); font-size: 16px; }
.article-main h2 { margin: 48px 0 15px; padding-top: 4px; font-size: 25px; line-height: 1.4; letter-spacing: -.025em; }
.article-main h3 { margin: 29px 0 9px; font-size: 19px; line-height: 1.5; }
.article-main p { margin: 0 0 16px; }
.article-main ul, .article-main ol { margin: 0 0 20px; padding-left: 1.4em; }
.article-main li + li { margin-top: 6px; }
.article-main code { padding: 2px 5px; color: #164e86; background: #eef6ff; border-radius: 5px; font-size: .92em; }
.article-main pre { overflow-x: auto; padding: 18px; color: #e5edf8; background: var(--navy); border-radius: 12px; font-size: 13px; line-height: 1.6; }
.article-meta-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 26px 0 32px; padding: 19px; background: var(--blue-pale); border: 1px solid #d8e7f5; border-radius: 14px; }
.article-meta-panel b { display: block; margin-bottom: 4px; font-size: 13px; }
.article-meta-panel p { margin: 0; font-size: 13px; }
.badge { display: inline-flex; padding: 3px 8px; color: var(--green); background: var(--green-soft); border: 1px solid #c9ecd5; border-radius: 999px; font-size: 11px; font-weight: 800; }
.question, .answer { margin: 24px 0; padding: 17px 20px; border-radius: 0 12px 12px 0; font-size: 18px; font-weight: 700; }
.question { background: #fffaf0; border-left: 4px solid #f1b63c; }
.answer { background: var(--blue-pale); border-left: 4px solid #78aaf7; }
.question strong, .answer strong { display: block; margin-bottom: 4px; font-size: 15px; }
.diagram { margin: 25px 0; padding: 26px 20px; background: var(--blue-pale); border: 1px solid #d7e7f6; border-radius: var(--radius); text-align: center; }
.diagram p { margin: 17px 0 0; color: #52647a; font-size: 13px; }
.flow { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; }
.flow-box { padding: 12px 15px; background: #fff; border: 1px solid #cfdeed; border-radius: 11px; font-weight: 700; }
.flow-arrow { color: var(--blue); font-size: 20px; font-weight: 800; }
.prompt-box { position: relative; margin: 19px 0; padding: 19px 20px; color: #e7effb; background: var(--navy); border-radius: 14px; }
.prompt-box small { color: #93c5fd; font-size: 11px; font-weight: 800; letter-spacing: .09em; }
.prompt-text { margin: 11px 42px 0 0; white-space: pre-wrap; font-size: 14px; line-height: 1.75; }
.copy-button { position: absolute; top: 16px; right: 16px; padding: 7px 10px; color: #dbeafe; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: 7px; font-size: 11px; }
.copy-button:hover { background: rgba(255,255,255,.18); }
.recap-box { margin-top: 19px; padding: 21px; background: var(--green-soft); border: 1px solid #ccebd6; border-radius: 14px; }
.recap-box p:last-child { margin-bottom: 0; }
.source-list { margin: 0; padding-left: 1.2em; color: var(--muted); font-size: 13px; }
.toc { position: sticky; top: 102px; }
.toc .side-link { font-size: 12px; }
.rule-card { margin: 22px 0; padding: 20px; background: #fbfaff; border: 1px solid #e8dffc; border-radius: 14px; }
.rule-card h3 { margin-top: 0; color: var(--purple); }

.glossary-list { width: min(920px, calc(100% - 48px)); margin: 0 auto; padding: 50px 0 80px; }
.letter-filter { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 27px; }
.letter-filter button { padding: 7px 10px; color: #52647a; background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.term-card { padding: 21px 0; border-bottom: 1px solid var(--line); }
.term-card h2 { margin: 0 0 6px; font-size: 21px; }
.term-simple { margin: 0 0 9px; color: var(--blue-dark); font-weight: 700; }
.term-card p { margin: 0; color: var(--muted); }
.definition-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.definition { padding: 12px; background: var(--blue-pale); border-radius: 10px; }
.definition small { display: block; margin-bottom: 4px; color: var(--subtle); font-size: 11px; font-weight: 800; }
.definition p { color: var(--ink); font-size: 13px; line-height: 1.6; }

.content-page { width: min(900px, calc(100% - 48px)); margin: 0 auto; padding: 60px 0 90px; }
.content-page h1 { margin: 9px 0 14px; font-size: clamp(32px, 4vw, 46px); line-height: 1.3; letter-spacing: -.04em; }
.content-page h2 { margin: 50px 0 13px; font-size: 25px; line-height: 1.45; }
.content-page h3 { margin: 28px 0 8px; font-size: 18px; }
.content-page .lead { max-width: 720px; color: var(--muted); font-size: 16px; }
.step-list { counter-reset: steps; margin: 30px 0; padding: 0; list-style: none; }
.step-list li { position: relative; min-height: 52px; margin: 0 0 24px; padding-left: 62px; }
.step-list li::before { counter-increment: steps; content: counter(steps); position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 38px; height: 38px; color: var(--blue-dark); background: var(--blue-soft); border-radius: 50%; font-weight: 800; }
.step-list h3 { margin: 0 0 3px; }
.step-list p { margin: 0; color: var(--muted); }
.info-list { display: grid; gap: 10px; margin: 23px 0; padding: 0; list-style: none; }
.info-list li { padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 11px; }
.info-list b { display: inline-block; min-width: 100px; margin-right: 8px; color: var(--blue-dark); }

.site-footer { padding: 35px 0 26px; background: #fff; border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; }
.footer-copy { margin: 0; color: var(--muted); font-size: 12px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 12px; }
.footer-nav a:hover { color: var(--blue-dark); }
.fine-print { margin: 24px 0 0; color: var(--subtle); font-size: 11px; }

@media (max-width: 1080px) {
  .docs-shell { grid-template-columns: minmax(0, 1fr) 205px; }
  .stage-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
  .wrap, .narrow, .glossary-list, .content-page { width: min(100% - 36px, 720px); }
  .hero { padding: 52px 0 48px; }
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .hero-visual { display: none; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .docs-shell { display: block; }
  .docs-side { display: none; }
  .article-main { padding: 37px 18px 66px; }
  .article-meta-panel, .split-callout { grid-template-columns: 1fr; }
  .definition-grid { grid-template-columns: 1fr; }
  .main-nav { display: none; position: absolute; top: 69px; right: 18px; left: 18px; flex-direction: column; align-items: stretch; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 10px 12px; }
  .nav-toggle { display: block; }
}
@media (max-width: 540px) {
  .wrap, .narrow, .glossary-list, .content-page { width: calc(100% - 32px); }
  .header-inner { min-height: 62px; }
  .site-header { min-height: 62px; }
  .brand { font-size: 13px; }
  .brand-mark { width: 26px; height: 26px; border-radius: 8px; font-size: 13px; }
  .main-nav { top: 61px; right: 16px; left: 16px; }
  .hero h1 { font-size: 32px; }
  .hero-lead { font-size: 15px; }
  .search-box { align-items: stretch; flex-wrap: wrap; }
  .search-box button { width: 100%; }
  .section { padding: 54px 0; }
  .grid-4, .grid-3, .stage-grid { grid-template-columns: 1fr; }
  .section-heading { margin-bottom: 24px; }
  .topic-card { min-height: auto; }
  .page-hero { padding: 45px 0 37px; }
  .page-hero h1, .content-page h1 { font-size: 32px; }
  .article-main h2, .content-page h2 { margin-top: 38px; font-size: 22px; }
  .flow { flex-direction: column; }
  .flow-arrow { transform: rotate(90deg); }
  .footer-inner { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
