/* 01. Base */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; color: #243241; background: #fff; font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif; font-size: 16px; line-height: 1.95; }
a { color: #1763a2; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #123d60; }
button, summary { font: inherit; }
:focus-visible { outline: 3px solid #1681ac; outline-offset: 4px; }
.skip-link { position: absolute; left: 16px; top: -80px; z-index: 100; padding: 8px 16px; background: #fff; }
.skip-link:focus { top: 8px; }

/* 02. Shared header and topic navigation */
.site-header { background: #0f3558; color: #fff; padding: 19px 24px; }
.header-inner { max-width: 1060px; margin: auto; }
.site-logo { color: #fff; font-size: 19px; font-weight: 700; text-decoration: none; }
.site-logo:hover, .site-logo:focus-visible { color: #fff; }
.site-nav { background: #14507d; color: #fff; }
.nav-inner { max-width: 1060px; margin: auto; display: flex; flex-wrap: wrap; gap: 0; align-items: stretch; padding: 0 14px; }
.nav-home, .nav-group > summary { display: block; padding: 12px 14px; color: #fff; font-size: 13px; cursor: pointer; text-decoration: none; }
.nav-group { position: relative; }
.nav-group > summary { list-style: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: '⌄'; margin-left: 8px; }
.nav-group[open] > summary, .nav-home:hover { background: #0c395c; color: #fff; }
.nav-group ul { position: absolute; top: 100%; left: 0; z-index: 40; width: 300px; max-width: calc(100vw - 32px); margin: 0; padding: 8px 0; background: #fff; color: #243241; border: 1px solid #c9dced; box-shadow: 0 6px 18px #0f35581a; list-style: none; }
.nav-group:last-child ul { left: auto; right: 0; }
.nav-group a { display: block; padding: 9px 16px; color: #153e60; text-decoration: none; font-size: 14px; line-height: 1.55; }
.nav-group a:hover, .nav-group a[aria-current] { background: #edf4fa; }

/* 03. Page title and main column */
.page-heading { background: #f2f6fa; border-bottom: 1px solid #e0e8ef; padding: 24px 24px 30px; }
.heading-inner { max-width: 800px; margin: auto; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 5px 9px; margin: 0 0 15px; padding: 0; list-style: none; font-size: 12px; color: #657282; line-height: 1.7; }
.breadcrumb li + li::before { content: '/'; margin-right: 9px; color: #7e8d9c; }
h1 { margin: 0; color: #0f3558; font-size: 28px; line-height: 1.6; overflow-wrap: anywhere; }
.page-meta { margin: 14px 0 0; font-size: 12px; color: #647181; }
.layout { position: relative; }
main { width: min(100%, 848px); padding: 36px 24px 64px; margin: auto; min-width: 0; }
main p { margin: 0 0 22px; overflow-wrap: anywhere; }
main h2 { color: #0f3558; font-size: 23px; line-height: 1.6; margin: 48px 0 20px; padding-bottom: 11px; border-bottom: 2px solid #b9d1e4; }
main h2:first-child { margin-top: 0; }
main h3 { color: #173e5f; font-size: 18px; line-height: 1.7; margin: 30px 0 12px; }
main ul, main ol { padding-left: 1.5em; margin: 18px 0 26px; }
main li { padding-left: 3px; margin: 8px 0; }
.page-image { margin: 28px 0 36px; }
.page-image img { display: block; width: 100%; height: auto; border-radius: 6px; border: 1px solid #d5e1eb; background: #f7f9fc; }
.page-image figcaption { margin-top: 10px; font-size: 13px; color: #657282; line-height: 1.75; }
.supervisor-logo { width: min(100%, 322px); margin: 28px auto 36px; }
.supervisor-logo img { border: 0; border-radius: 0; background: #fff; }

/* 04. Article tools, examples, tables and notes */
.toc { margin: 28px 0 36px; padding: 16px 20px; background: #f4f8fb; border: 1px solid #d6e3ed; border-radius: 6px; }
.toc summary { cursor: pointer; color: #173e5f; font-weight: 700; }
.toc ol { margin: 12px 0 0; font-size: 14px; }
.toc a { text-decoration: none; }
.highlight, .example, .question-box { padding: 20px 24px; margin: 26px 0; background: #f1f6fa; border: 1px solid #cfdeea; border-radius: 6px; }
.example { background: #fafbfc; }
.example p:last-child, .highlight p:last-child, .question-box p:last-child { margin-bottom: 0; }
.example h3, .question-box h3 { margin-top: 0; }
.director-note { background: #fffaf3; border: 1px solid #ead6bc; border-radius: 8px; padding: 22px 24px; margin: 32px 0; }
.director-note h3 { color: #7a4307; margin: 0 0 12px; font-size: 18px; }
.director-note p:last-child { margin-bottom: 0; }
.table-scroll { overflow-x: auto; margin: 24px 0 28px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.8; }
caption { padding-bottom: 10px; text-align: left; color: #173e5f; font-weight: 700; }
th, td { border: 1px solid #d3e0ea; text-align: left; vertical-align: top; padding: 13px 15px; min-width: 120px; overflow-wrap: anywhere; }
th { background: #edf4fa; color: #143b5a; }
tbody tr:nth-child(even) { background: #fafcfe; }
.step { display: flex; gap: 18px; margin: 30px 0; }
.step-num { flex: 0 0 38px; height: 38px; border-radius: 50%; background: #14507d; color: #fff; text-align: center; line-height: 38px; font-weight: bold; }
.step-body { min-width: 0; }
.step-body h3 { margin-top: 0; }
.faq-item { padding: 20px 0; border-bottom: 1px solid #dce5ed; }
.faq-item h3 { margin-top: 0; }
.sources { font-size: 13px; color: #576779; }

/* 05. Floating contents and service reference */
.floating-guide { position: fixed; top: 174px; right: max(24px, calc((100vw - 848px) / 2 - 280px)); width: 250px; max-height: calc(100vh - 194px); overflow-y: auto; padding-bottom: 8px; }
.side-nav { padding: 18px; margin-bottom: 20px; background: #f8fbff; border: 1px solid #c9dced; border-radius: 6px; }
.side-nav h2 { font-size: 14px; margin: 0 0 10px; color: #173e5f; }
.side-nav ul { list-style: none; margin: 0; padding: 0; }
.side-nav li + li { border-top: 1px dotted #d7e1e9; }
.side-nav a { display: block; padding: 7px 0; font-size: 13px; text-decoration: none; line-height: 1.65; }
.side-nav a[aria-current] { font-weight: 700; color: #0f3558; }
.service-reference { margin: 36px 0 0; padding-top: 18px; border-top: 1px solid #dce5ed; color: #566676; font-size: 14px; }
.sample-image { margin: 22px 0; }
.sample-image img { display: block; width: 100%; height: auto; border-radius: 6px; }
.sample-image figcaption { margin-top: 10px; color: #566676; font-size: 14px; line-height: 1.8; }

/* 06. Topic directory and related reading */
.topic-directory { margin-top: 48px; }
.topic-section { padding: 12px 0 22px; border-bottom: 1px solid #dce5ed; }
.topic-section h3 { margin: 12px 0; }
.article-list { list-style: none; padding: 0; margin: 0; }
.article-list li { margin: 0; padding: 16px 0; border-bottom: 1px solid #e8edf2; }
.article-list li:last-child { border-bottom: 0; }
.article-list a { font-weight: 700; text-decoration: none; line-height: 1.7; }
.article-list p { font-size: 14px; margin: 6px 0 0; line-height: 1.85; color: #566676; }
.related { margin-top: 44px; padding-top: 12px; border-top: 1px solid #dce5ed; }
.site-footer { padding: 30px 24px; text-align: center; background: #0f3558; color: #d7e9f7; font-size: 13px; }
.site-footer p { margin: 5px 0; }
.site-footer a { color: #fff; }

/* 07. Responsive layout */
@media (max-width: 1439px) {
  .floating-guide { position: static; width: min(100%, 848px); max-height: none; padding: 0 24px 40px; margin: auto; }
  .side-nav ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
}
@media (max-width: 1060px) {
  .nav-inner { position: relative; }
  .nav-group { position: static; }
  .nav-group ul, .nav-group:last-child ul { left: 14px; right: 14px; width: auto; max-width: none; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .site-header { padding: 17px 20px; }
  .site-logo { font-size: 17px; }
  .nav-inner { padding: 0 8px; }
  .nav-home, .nav-group > summary { padding: 10px 9px; font-size: 12px; }
  .nav-group ul, .nav-group:last-child ul { left: 8px; right: 8px; }
  .page-heading { padding: 22px 20px 24px; }
  h1 { font-size: 23px; }
  main { padding: 28px 20px 44px; }
  main h2 { font-size: 20px; margin-top: 36px; }
  main h3 { font-size: 17px; }
  .highlight, .example, .question-box, .director-note { padding: 18px; }
  .floating-guide { padding: 0 20px 32px; }
  .side-nav ul { display: block; }
  .step { gap: 12px; }
}
