:root {
  --navy: #173e58;
  --ink: #173e58;
  --body: #2b4252;
  --muted: #49616d;
  --yellow: #f6bb55;
  --mint: #dcefeb;
  --blue: #dceef7;
  --soft: #f4f7f8;
  --paper: #fff;
  --line: #9bb7c1;
  --line-light: #c9dde2;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--body);
  background: var(--paper);
  font-family: "Zen Kaku Gothic New", "Yu Gothic", YuGothic, sans-serif;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.85;
  overflow-wrap: break-word;
  word-break: auto-phrase;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection { color: var(--paper); background: var(--navy); }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 4px; }
a { color: inherit; text-underline-offset: 4px; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink); text-wrap: balance; }

.skip-link { position: fixed; z-index: 30; top: -70px; left: 16px; padding: 10px 14px; color: var(--paper); background: var(--navy); text-decoration: none; }
.skip-link:focus { top: 16px; }
.container { width: min(var(--max), calc(100% - 48px)); margin-inline: auto; }

.site-header { border-bottom: 1px solid #e2edf0; background: var(--paper); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 74px; gap: 24px; }
.brand { display: inline-flex; align-items: baseline; gap: 11px; color: var(--navy); text-decoration: none; }
.brand strong, .footer-name { font-family: Outfit, sans-serif; font-weight: 900; letter-spacing: -0.05em; }
.brand strong { font-size: 22px; }
.brand span { font-size: 12px; font-weight: 700; }
.site-nav { display: flex; align-items: center; gap: clamp(12px, 2.2vw, 30px); }
.site-nav a { font-size: 13px; font-weight: 700; text-decoration: none; text-underline-offset: 6px; }
.site-nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; }

.breadcrumbs { padding: 18px 0; border-bottom: 1px solid var(--line-light); color: var(--muted); font-size: 0.86rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 0; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li + li::before { margin: 0 0.55em; content: "›"; }
.breadcrumbs a { color: var(--navy); }

.article-shell { width: min(100% - 32px, 1000px); margin-inline: auto; }
.article-header { max-width: 760px; padding: clamp(36px, 7vw, 72px) 0 clamp(30px, 5vw, 54px); }
.article-header h1 { margin-bottom: 22px; font-size: clamp(1.9rem, 4.8vw, 3.05rem); font-weight: 900; letter-spacing: -0.055em; line-height: 1.32; }
.article-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 20px; padding: 13px 0; border-top: 2px solid var(--navy); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.88rem; }
.article-author { max-width: 43em; margin-bottom: 0; color: var(--muted); font-size: 0.94rem; line-height: 1.75; }
.article-author a { color: var(--navy); font-weight: 700; }

.answer-box { max-width: 760px; margin: 0 0 clamp(34px, 6vw, 62px); padding: clamp(22px, 4vw, 34px); border: 2px solid var(--navy); background: var(--mint); }
.answer-box .answer-title { margin-bottom: 16px; font-size: clamp(1.35rem, 3vw, 1.75rem); letter-spacing: -0.035em; line-height: 1.4; }
.answer-box ul { display: grid; gap: 13px; margin: 0; padding: 0; list-style: none; }
.answer-box li { padding-left: 1.1em; text-indent: -1.1em; }
.answer-box li::before { padding-right: 0.35em; color: var(--navy); content: "■"; font-size: 0.78em; }

.toc { max-width: 760px; margin: 0 0 clamp(40px, 7vw, 72px); padding: 20px 0; border-top: 2px solid var(--navy); border-bottom: 1px solid var(--line); }
.toc p { margin: 0 0 9px; color: var(--navy); font-family: Outfit, sans-serif; font-size: 0.82rem; font-weight: 800; letter-spacing: 0.11em; }
.toc ol { display: grid; gap: 5px; margin: 0; padding-left: 1.4em; }
.toc a { color: var(--navy); font-weight: 700; text-decoration-thickness: 1px; }

.article-body { max-width: 760px; }
.article-body > section { margin-bottom: clamp(48px, 8vw, 84px); scroll-margin-top: 24px; }
.article-body h2 { margin-bottom: 22px; padding-bottom: 13px; border-bottom: 2px solid var(--navy); font-size: clamp(1.45rem, 3vw, 2rem); letter-spacing: -0.04em; line-height: 1.42; }
.article-body h3 { margin: 28px 0 12px; color: var(--navy); font-size: 1.08rem; line-height: 1.5; }
.article-body p { max-width: 40em; margin-bottom: 1.25em; }
.article-body ul, .article-body ol { max-width: 40em; margin: 0 0 1.35em; padding-left: 1.45em; }
.article-body li + li { margin-top: 0.55em; }
.checklist { padding: clamp(22px, 4vw, 30px); border: 2px solid var(--navy); background: var(--soft); }
.checklist h2 { margin-bottom: 20px; }
.checklist .check-title { margin: 24px 0 8px; color: var(--ink); }
.checklist .check-title:first-of-type { margin-top: 0; }
.checklist ul { margin-bottom: 0; padding: 0; list-style: none; }
.checklist li { position: relative; padding-left: 1.7em; }
.checklist li::before { position: absolute; left: 0; top: 0.2em; width: 0.78em; height: 0.78em; border: 2px solid var(--navy); content: ""; }

.download-callout, .sample-callout { max-width: 760px; margin: 28px 0 0; padding: clamp(22px, 4vw, 32px); border-top: 2px solid var(--navy); border-bottom: 1px solid var(--line); }
.download-callout { background: var(--blue); }
.download-callout h3, .sample-callout h3 { margin: 0 0 7px; color: var(--ink); font-size: clamp(1.2rem, 2.5vw, 1.45rem); }
.download-callout p, .sample-callout p { margin-bottom: 15px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 56px; gap: 10px; padding: 13px 20px; border: 2px solid var(--navy); color: var(--navy); background: var(--yellow); font-weight: 900; line-height: 1.35; text-align: center; text-decoration: none; transition: color 0.15s ease-out, background-color 0.15s ease-out; }
.button:hover { color: var(--paper); background: var(--navy); }
.button::after { content: "→"; }
.download-callout small, .sample-callout small { display: block; margin-top: 12px; color: var(--muted); font-size: 0.86rem; line-height: 1.65; }

.table-scroll { max-width: 100%; margin: 22px 0; overflow-x: auto; border: 2px solid var(--navy); background: var(--paper); -webkit-overflow-scrolling: touch; }
table { width: 100%; min-width: 620px; border-collapse: collapse; color: var(--body); font-size: 0.94rem; line-height: 1.65; }
th, td { padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
thead th { color: var(--paper); background: var(--navy); font-family: Outfit, sans-serif; font-size: 0.82rem; font-weight: 800; letter-spacing: 0.04em; }
tbody th { width: 9.5em; color: var(--ink); font-weight: 900; }
tr > :last-child { border-right: 0; }
tbody tr:last-child > * { border-bottom: 0; }

.sample-figure { margin: 28px 0; border: 2px solid var(--navy); background: var(--paper); }
.sample-figure img { width: 100%; }
.sample-figure figcaption { padding: 10px 13px; border-top: 1px solid var(--navy); color: var(--muted); font-size: 0.86rem; }
.sample-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 25px 0; }
.sample-pair .sample-figure { margin: 0; }

.source-list { padding: 0; list-style: none; }
.source-list li { padding: 15px 0; border-bottom: 1px solid var(--line); }
.source-list a { color: var(--navy); font-weight: 700; overflow-wrap: anywhere; }
.operator { padding: clamp(22px, 4vw, 32px); border-top: 2px solid var(--navy); background: var(--mint); }
.operator p:last-child { margin-bottom: 0; }

footer { margin-top: clamp(52px, 8vw, 92px); padding: 40px 0; color: var(--paper); background: var(--navy); }
.footer-inner { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.footer-inner p { margin-bottom: 0; }
.footer-name { font-size: 30px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 22px; }
.footer-links a { color: var(--paper); font-size: 0.88rem; }

@media (max-width: 760px) {
  .container { width: min(100% - 32px, var(--max)); }
  .header-inner { min-height: 62px; }
  .brand strong { font-size: 20px; }
  .site-nav { gap: 12px; }
  .site-nav a { font-size: 12px; }
  .site-nav a:nth-child(2) { display: none; }
  .article-shell { width: min(100% - 32px, 760px); }
  .article-header { padding-top: 34px; }
  .article-header h1 { text-wrap: wrap; overflow-wrap: anywhere; word-break: break-all; }
  .article-meta { gap: 2px 12px; }
  .button { width: 100%; }
  .sample-pair { grid-template-columns: 1fr; }
  .footer-inner { display: block; }
  .footer-links { justify-content: flex-start; margin-top: 20px; }
}

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

@media print {
  .site-header, .breadcrumbs, .toc, .download-callout, .sample-callout, footer { display: none; }
  .article-shell { width: auto; }
  .table-scroll { overflow: visible; }
}

.kiji-list { list-style: none; margin: 24px 0; padding: 0; display: grid; gap: 12px; }
.kiji-list a { display: block; padding: 16px 18px; border: 1px solid currentColor; border-radius: 8px; color: inherit; text-decoration: none; }
.kiji-list a:hover, .kiji-list a:focus-visible { text-decoration: underline; }
.kiji-list strong { display: block; font-size: 1.1rem; line-height: 1.5; }
.kiji-list span { display: block; margin-top: 6px; font-size: 1rem; line-height: 1.7; }
.kiji-list-cta { margin: 24px 0 48px; font-size: 1rem; }
