@charset "utf-8";

:root {
  color-scheme: light;
  --content-width: 820px;
  --shell-width: 1200px;
  --header-height: 72px;
  --font-body: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  --font-gothic: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  --font-note: "Zen Kurenaido", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-body);
  background: var(--page-bg);
}
img, svg { display: block; max-width: 100%; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { text-decoration-thickness: .14em; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
  box-shadow: 0 0 0 4px var(--focus-soft);
}
.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 10px;
  background: var(--action);
  color: var(--on-action);
  transform: translateY(-150%);
}
.skip-link:focus { transform: none; }
.site-header {
  position: relative;
  z-index: 20;
  min-height: var(--header-height);
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
}
.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100% - 32px, var(--shell-width));
  min-height: var(--header-height);
  margin-inline: auto;
  color: var(--heading);
  font-weight: 700;
  text-decoration: none;
}
.brand-link img { width: 44px; height: 44px; object-fit: contain; }
.page-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, var(--content-width));
  justify-content: center;
  gap: clamp(36px, 6vw, 88px);
  width: min(100% - 48px, var(--shell-width));
  margin-inline: auto;
  padding-block: 48px 96px;
}
.page-shell--single {
  display: block;
  width: min(100% - 48px, 720px);
}
.desktop-toc { min-width: 0; }
.desktop-toc > .toc { position: sticky; top: 28px; }
.toc {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--card-bg);
  box-shadow: var(--shadow-soft);
}
.toc-title {
  margin: 0 0 10px;
  color: var(--heading);
  font-size: 14px;
  font-weight: 700;
}
.toc ol { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.toc li { margin: 0; }
.toc a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 7px 9px;
  border-radius: var(--radius-small);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  text-decoration: none;
}
.toc a:hover { color: var(--heading); background: var(--hover-bg); }
.toc a.is-current {
  border-left: 4px solid var(--action);
  color: var(--heading);
  background: var(--hover-bg);
  font-weight: 700;
}
.article { min-width: 0; }
.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 24px;
  color: var(--link);
  font-size: 15px;
  font-weight: 700;
}
.mobile-toc { display: none; }
.prose { min-width: 0; }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.prose > :first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  scroll-margin-top: 24px;
  color: var(--heading);
  font-family: var(--heading-font, var(--font-body));
  line-height: 1.35;
  letter-spacing: -.015em;
}
.prose h1, .page-title { margin: 0 0 36px; font-size: clamp(34px, 6vw, 48px); }
.prose h2 {
  margin: 64px 0 24px;
  padding: var(--h2-padding);
  border: var(--h2-border);
  border-radius: var(--h2-radius);
  background: var(--h2-bg);
  font-size: clamp(27px, 4vw, 34px);
}
.prose h3 { margin: 42px 0 16px; font-size: clamp(22px, 3vw, 26px); }
.prose h4 { margin: 34px 0 12px; font-size: 20px; }
.prose p { margin: 0 0 1.45em; }
.prose strong { color: var(--strong); font-weight: 700; }
.prose code:not(pre code) {
  padding: .1em .4em;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--code-inline-bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
}
.prose ul, .prose ol { margin: 0 0 1.6em; padding-left: 1.5em; }
.prose li { margin: .35em 0; padding-left: .2em; }
.prose li::marker { color: var(--action); font-weight: 700; }
.section-rule { margin: 54px 0; border: 0; border-top: 1px solid var(--border); }
figure { margin: 32px auto; }
figure img { margin-inline: auto; border-radius: var(--radius-card); max-width: min(100%, 220px); }
figcaption { margin-top: 8px; color: var(--muted); font-size: 14px; text-align: center; }
.promo-video { margin: 28px auto 36px; }
.promo-video video { display: block; margin-inline: auto; background: var(--ink-900, #222); box-shadow: var(--shadow-soft); }
.callout {
  margin: 30px 0;
  padding: 20px;
  border: var(--callout-border);
  border-radius: var(--radius-card);
  background: var(--callout-bg);
  box-shadow: var(--callout-shadow);
}
.callout-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--callout-heading);
  font-weight: 700;
}
.callout-icon {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.callout-body > :last-child { margin-bottom: 0; }
.callout-tip .callout-heading span { background: var(--tip-mark, transparent); }
.code-block {
  position: relative;
  margin: 30px 0;
  border: 1px solid var(--code-border);
  border-radius: var(--radius-card);
  overflow: clip;
  background: var(--code-bg);
  box-shadow: var(--shadow-soft);
}
.code-block .copy-button {
  position: sticky;
  z-index: 2;
  top: 10px;
  display: block;
  min-width: 74px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--code-button-border);
  border-radius: var(--radius-small);
  color: var(--code-button-text);
  background: var(--code-button-bg);
  font: 700 14px/1 var(--font-body);
  cursor: pointer;
  margin: 10px 10px -54px auto;
}
.copy-button:hover { background: var(--code-button-hover); }
pre {
  max-width: 100%;
  margin: 0;
  padding: 68px 20px 22px;
  overflow-x: auto;
  color: var(--code-text);
  font: 14px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  tab-size: 2;
  white-space: pre;
}
.table-scroll {
  max-width: 100%;
  margin: 30px 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--card-bg);
}
table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; line-height: 1.55; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: var(--heading); background: var(--table-head-bg); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
.checklist { padding-left: 0 !important; list-style: none; }
.checklist li { display: flex; align-items: flex-start; gap: 10px; padding-left: 0; }
.check-box { flex: 0 0 18px; width: 18px; height: 18px; margin-top: .38em; border: 2px solid var(--action); border-radius: 4px; background: var(--card-bg); }
.next-card {
  margin-top: 36px !important;
  padding: 20px 22px;
  border: 1px solid var(--action);
  border-radius: var(--radius-card);
  background: var(--next-bg);
  box-shadow: var(--shadow-soft);
  font-size: 19px;
  font-weight: 700;
}
.next-card a { display: inline-flex; align-items: center; min-height: 44px; }
.source-toggle { margin: 24px 0; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--card-bg); }
.source-toggle summary { min-height: 44px; padding: 12px 16px; color: var(--heading); font-weight: 700; cursor: pointer; }
.source-toggle > :not(summary) { margin-inline: 16px; }
.site-footer {
  padding: 32px 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  background: var(--footer-bg);
  font-size: 14px;
  text-align: center;
}

@media (max-width: 820px) {
  .page-shell { display: block; width: min(100% - 32px, var(--content-width)); padding-block: 28px 72px; }
  .desktop-toc { display: none; }
  .mobile-toc {
    display: block;
    margin-bottom: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--card-bg);
    box-shadow: var(--shadow-soft);
  }
  .mobile-toc > summary { display: flex; align-items: center; min-height: 52px; padding: 10px 16px; color: var(--heading); font-size: 15px; font-weight: 700; cursor: pointer; list-style: none; }
  .mobile-toc > summary::-webkit-details-marker { display: none; }
  .mobile-toc > summary::after { content: "▼"; margin-left: auto; padding-left: 12px; font-size: 12px; }
  .mobile-toc[open] > summary::after { content: "▲"; }
  .mobile-toc > .toc { border: 0; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-card) var(--radius-card); box-shadow: none; }
  .mobile-toc .toc-title { display: none; }
  .prose h2 { margin-top: 52px; }
}

@media (max-width: 767px) {
  .code-block--long pre { max-height: 480px; overflow-y: auto; }
}

@media (max-width: 420px) {
  body { font-size: 18px; }
  .brand-link { width: calc(100% - 24px); gap: 8px; font-size: 16px; }
  .brand-link img { width: 40px; height: 40px; }
  .page-shell { width: calc(100% - 28px); }
  .callout { padding: 17px; }
  pre { padding-inline: 16px; }
  th, td { padding: 12px; }
}

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

/* メルマガ登録フォーム（register.html・埋め込みスニペット共通の型） */
.register-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin: 20px 0;
}
.register-form label {
  flex-basis: 100%;
  font-weight: 700;
}
.register-form input[type="email"] {
  flex: 1 1 260px;
  min-height: 48px;
  padding: 10px 14px;
  border: 1.5px solid var(--code-button-border, currentColor);
  border-radius: 10px;
  font: inherit;
  color: var(--text-body);
  background: var(--page-bg);
}
.register-form button {
  min-height: 48px;
  padding: 10px 24px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: var(--action);
  color: var(--on-action);
}
#register-status { font-weight: 700; min-height: 1.5em; }
