/* 公開ページ全体の土台。トップ（index.html）も中面（画面・マニュアル・変更履歴）もこれを読む。
   配色はアプリのアイコンと同じ濃紺（#16233A）と黄色（#FFF080）。白地では黄色が読めないので、
   白地の差し色は深い琥珀（--amber）にし、黄色は濃紺の地の上だけで使う。
   赤（--alert）は「ここを見ろ」の1点だけ（SmartScreen の注意など）。
   フォントは Windows の標準（メイリオ・Yu Gothic）にそろえる。アプリと同じ文字で読める。 */
:root {
  color-scheme: light;
  --navy: #16233a;       /* 主の色。見出し・ボタン・帯 */
  --navy-2: #24365a;     /* ボタンのホバー */
  --yellow: #fff080;     /* 濃紺の上の差し色（アイコンの線と同じ） */
  --amber: #a07c1c;      /* 白地の差し色（小見出しの飾り・チェック） */
  --amber-soft: #fbf5df; /* 淡い黄 */
  --alert: #c50102;      /* 注意の1点だけ */
  --ink: #1b2432;
  --sub: #5b6b85;
  --line: #e2e7ef;
  --panel: #f5f7fa;
  --link: #0b57b8;
  --radius: 10px;
  --wrap: 1120px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: "Yu Gothic UI", "Meiryo", "Hiragino Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.9;
  /* **日本語と英数字のあいだはブラウザに空けさせる。** 原稿に半角空白を書かない。 */
  text-autospace: normal;
  text-spacing-trim: normal;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--navy); }
img { max-width: 100%; height: auto; }
code {
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px;
  padding: 1px 6px; font-size: .9em;
  font-family: "Cascadia Mono", Consolas, "MS Gothic", monospace;
}
pre {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; overflow-x: auto; line-height: 1.7;
  font-family: "Cascadia Mono", Consolas, "MS Gothic", monospace;
}
pre code { background: none; border: 0; padding: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }
.nowrap { display: inline-block; }

/* =====================================================================
   上に固定のナビ（全ページ共通）
   ===================================================================== */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; gap: 28px; height: 62px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--navy); font-weight: 700; font-size: 18px; letter-spacing: .01em; text-decoration: none; margin-right: auto; }
.logo svg { width: 28px; height: 28px; border-radius: 7px; flex: none; }
.nav nav { display: flex; gap: 24px; }
.nav nav a { color: var(--sub); text-decoration: none; font-size: 14.5px; font-weight: 500; }
.nav nav a:hover { color: var(--navy); }
.nav nav a[aria-current="page"] { color: var(--navy); font-weight: 700; }
@media (max-width: 900px) { .nav nav { display: none; } }
/* 狭い画面ではロゴを1行に保ち、ナビのボタンは出さない（引き出しに「ダウンロード」がある） */
@media (max-width: 600px) {
  :root { --nav-h: 56px; }
  .nav-in { height: 56px; gap: 8px; }
  .logo { font-size: 16px; white-space: nowrap; }
  .nav .btn-sm { display: none; }
}

/* ボタン */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 28px; border-radius: 8px; font-weight: 700; font-size: 16px;
  text-decoration: none; background: var(--navy); color: #fff; border: 1.5px solid var(--navy); transition: background .15s; }
.btn:hover { background: var(--navy-2); color: #fff; }
.btn small { font-weight: 400; font-size: .82em; opacity: .85; }
.btn-ghost { background: #fff; color: var(--navy); }
.btn-ghost:hover { background: var(--panel); color: var(--navy); }
.btn-sm { padding: 8px 18px; font-size: 14px; border-radius: 6px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.center { justify-content: center; text-align: center; }
@media (max-width: 600px) { .cta-row .btn { width: 100%; } }

/* 画面写しの枠 */
.window { border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 16px 40px rgba(22, 35, 58, .14), 0 0 0 1px rgba(22, 35, 58, .08); }
.window img { display: block; width: 100%; height: auto; border: none; border-radius: 0; }
figure img { cursor: zoom-in; }

/* =====================================================================
   中面（body.doc-page）。上のナビの下は、左の目次と右の本文に分ける。
   ===================================================================== */
.doc { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 52px; align-items: start; padding-top: 40px; padding-bottom: 88px; }
.doc main { min-width: 0; }

.toc { position: sticky; top: 86px; max-height: calc(100vh - 110px); overflow-y: auto;
  padding: 18px 14px; border-radius: var(--radius); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.toc-title { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; padding-left: 10px; color: var(--amber); font-weight: 700; font-size: 12px; letter-spacing: .16em; }
.toc-title::before { content: ""; width: 18px; height: 2px; background: var(--amber); }
.toc nav { display: flex; flex-direction: column; gap: 2px; font-size: 14.5px; line-height: 1.6; counter-reset: ch; }
.toc nav a { position: relative; display: block; padding: 6px 10px; border-radius: 6px; color: var(--sub); text-decoration: none; }
.toc nav a:hover { color: var(--navy); background: #fff; }
.toc nav a[aria-current="page"] { color: #fff; font-weight: 700; background: var(--navy); }
/* マニュアルの章は一段下げて番号を付ける */
.toc nav a.chap { padding-left: 24px; font-size: 13.5px; counter-increment: ch; }
.toc nav a.chap::before { content: counter(ch) ". "; color: var(--amber); }
.toc nav a.chap[aria-current="page"]::before { color: var(--yellow); }
.toc .other-app { margin: 14px 0 0; padding: 12px 10px 0; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--sub); }
.toc .other-app a { display: block; margin-top: 2px; font-size: 14px; font-weight: 500; color: var(--navy); text-decoration: none; }
.toc .other-app a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .doc { grid-template-columns: 1fr; gap: 24px; padding-top: 24px; padding-bottom: 56px; }
  /* 目次はハンバーガーの引き出しに出す（menu.js） */
  .toc { display: none; }
}

/* 本文 */
.doc-page main { font-size: 16px; line-height: 1.95; }
.doc-page main h1 { margin: 0 0 18px; padding-bottom: 12px; border-bottom: 3px solid var(--navy); font-size: clamp(24px, 2.4vw, 30px); line-height: 1.45; font-weight: 700; }
.doc-page main h2 { margin: 56px 0 14px; padding: 0 0 0 14px; position: relative; font-size: clamp(19px, 1.8vw, 22px); font-weight: 700; line-height: 1.5; }
.doc-page main h2::before { content: ""; position: absolute; left: 0; top: .32em; bottom: .32em; width: 4px; border-radius: 2px; background: var(--navy); }
.doc-page main h3 { margin: 32px 0 8px; font-size: 17px; font-weight: 700; }
.doc-page main h3[id], .doc-page main h2[id] { scroll-margin-top: 84px; }
.doc-page main p.lead { font-size: 17px; color: var(--sub); }
.doc-page main figure { margin: 18px 0 28px; }
.doc-page main figure img { display: block; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(22, 35, 58, .08); }
.doc-page main figcaption { margin-top: 8px; color: var(--sub); font-size: .9rem; }
.doc-page main table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 15px; }
.doc-page main th, .doc-page main td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.doc-page main th { background: var(--panel); white-space: nowrap; }
.doc-page main blockquote { margin: 18px 0; padding: 10px 18px; border-left: 4px solid var(--amber); background: var(--amber-soft); border-radius: 0 8px 8px 0; }
.doc-page main blockquote p { margin: 0; }
.doc-page main ol.toc-list { padding-left: 1.4em; }
.doc-page main ol.toc-list li { margin: 6px 0; }
.doc-page main .changelog td.ver { white-space: nowrap; font-weight: 700; color: var(--navy); }
.doc-page main .changelog td.date { white-space: nowrap; color: var(--sub); }
.pager { display: flex; gap: 16px; margin: 56px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: .94rem; }
.pager .next { margin-left: auto; }
.callout { border: 1px solid var(--line); border-left: 4px solid var(--alert); border-radius: 6px; background: var(--panel); padding: 16px 20px; margin: 18px 0; }
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }
@media (max-width: 600px) {
  .doc-page main table { display: block; overflow-x: auto; }
  .doc-page main code { overflow-wrap: anywhere; }
  .pager { flex-wrap: wrap; gap: 10px; }
  .pager .next { margin-left: 0; }
}

/* =====================================================================
   末尾（全ページ共通）
   ===================================================================== */
footer.site { border-top: 1px solid var(--line); font-size: 13px; color: var(--sub); background: #fff; }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; padding-top: 22px; padding-bottom: 36px; }
footer.site a { color: var(--navy); }
footer.site .disclaimer { flex-basis: 100%; margin: 4px 0 0; font-size: 12.5px; line-height: 1.7; }

/* =====================================================================
   画面写しの拡大（lightbox.js）
   ===================================================================== */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(16, 20, 28, .9);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 72px; }
@media (max-width: 520px) { .lightbox { padding: 56px 8px 72px; } }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 80px); object-fit: contain; background: #fff; border-radius: 4px; box-shadow: 0 8px 32px rgba(0, 0, 0, .4); cursor: default; }
.lightbox-caption { color: #f0f0f0; font-size: 14px; margin: 10px 0 0; }
.lightbox button { position: absolute; border: none; border-radius: 50%; width: 48px; height: 48px; font-size: 32px; line-height: 1;
  color: #fff; background: rgba(255, 255, 255, .16); cursor: pointer; }
.lightbox button:hover, .lightbox button:focus-visible { background: rgba(255, 255, 255, .32); outline: none; }
.lightbox button[hidden] { display: none; }
.lightbox-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lightbox-close { right: 12px; top: 12px; width: 40px; height: 40px; font-size: 26px; }
@media (max-width: 520px) { .lightbox-prev, .lightbox-next { top: auto; bottom: 12px; transform: none; } }
body.lightbox-open { overflow: hidden; }

/* =====================================================================
   スマホのメニュー（menu.js）。幅 900px 以下で、ナビの右にハンバーガー、押すと右から引き出し
   ===================================================================== */
.lp-menu-button, .lp-menu-drawer, .lp-menu-overlay { display: none; }
@media (max-width: 900px) {
  .nav-in { gap: 12px; }
  .lp-menu-button { display: inline-flex; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; padding: 0 10px;
    margin-right: -10px; border: 0; background: none; cursor: pointer; }
  .lp-menu-button span { display: block; height: 2px; border-radius: 1px; background: var(--navy); transition: transform .2s, opacity .2s; }
  .lp-menu-open .lp-menu-button span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .lp-menu-open .lp-menu-button span:nth-child(2) { opacity: 0; }
  .lp-menu-open .lp-menu-button span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .lp-menu-overlay { display: block; position: fixed; inset: var(--nav-h, 62px) 0 0 0; z-index: 48; background: rgba(22, 35, 58, .35);
    opacity: 0; pointer-events: none; transition: opacity .2s; }
  .lp-menu-open .lp-menu-overlay { opacity: 1; pointer-events: auto; }
  .lp-menu-drawer { display: block; position: fixed; top: var(--nav-h, 62px); right: 0; bottom: 0; z-index: 49; width: min(320px, 86vw); overflow-y: auto;
    padding: 20px 16px 32px; background: var(--panel); box-shadow: -8px 0 24px rgba(22, 35, 58, .12);
    transform: translateX(100%); transition: transform .22s ease; }
  .lp-menu-open .lp-menu-drawer { transform: none; }
  .lp-menu-open { overflow: hidden; }
  .lp-menu-main { display: flex; flex-direction: column; gap: 2px; }
  .lp-menu-main a { display: block; padding: 10px; border-radius: 8px; color: var(--navy); font-weight: 700; font-size: 15px; text-decoration: none; }
  .lp-menu-main a[aria-current="page"] { background: #fff; box-shadow: 0 0 0 1px var(--line); }
  /* 中面の目次の写し（.toc を複製したもの） */
  .lp-menu-toc .toc-title { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; padding-left: 10px; color: var(--amber); font-weight: 700; font-size: 12px; letter-spacing: .16em; }
  .lp-menu-toc .toc-title::before { content: ""; width: 18px; height: 2px; background: var(--amber); }
  .lp-menu-toc nav { display: flex; flex-direction: column; gap: 2px; font-size: 14.5px; line-height: 1.6; counter-reset: ch; }
  .lp-menu-toc nav a { display: block; padding: 9px 10px; border-radius: 8px; color: var(--sub); text-decoration: none; }
  .lp-menu-toc nav a.chap { padding-left: 24px; font-size: 13.5px; counter-increment: ch; overflow-wrap: anywhere; }
  .lp-menu-toc nav a.chap::before { content: counter(ch) ". "; color: var(--amber); }
  .lp-menu-toc nav a[aria-current="page"] { color: #fff; font-weight: 700; background: var(--navy); }
  .lp-menu-toc .other-app { margin: 16px 0 0; padding: 14px 10px 0; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--sub); }
  .lp-menu-toc .other-app a { display: block; margin-top: 4px; font-size: 14px; font-weight: 500; color: var(--navy); text-decoration: none; }
}

/* =====================================================================
   印刷（PDF）。マニュアルの全章をつないだ print.html をヘッドレスEdgeで印刷する。
   本文の高さは A4(297mm) から上下の余白(20mm×2)を引いた 257mm。画像はその半分まで。
   ===================================================================== */
@page { size: A4; margin: 20mm 17mm; }
@media print {
  .nav, .toc, .pager, footer.site, .lp-menu-button, .lp-menu-drawer, .lp-menu-overlay { display: none !important; }
  .doc { display: block; max-width: none; padding: 0; }
  body, .doc-page main { font-size: 10.5pt; line-height: 1.8; }
  .doc-page main h1 { margin: 0 0 14px; padding-bottom: 8px; }
  .doc-page main h2 { margin: 28px 0 10px; }
  .doc-page main h3 { margin: 18px 0 6px; }
  .doc-page main figure { margin: 10px 0 16px; }
  section.chapter { break-before: page; }
  section.chapter:first-of-type { break-before: auto; }
  h1, h2, h3 { break-after: avoid; }
  table, pre, blockquote, figure { break-inside: avoid; }
  .doc-page main figure { text-align: center; }
  .doc-page main figure img { display: inline-block; max-height: 128mm; width: auto; box-shadow: none; }
  a { color: var(--ink); text-decoration: none; }
}

/* お問い合わせのフォーム（docs/pages/contact.html。送り方は contact.js） */
.contact-form { display: flex; flex-direction: column; gap: 22px; max-width: 720px; margin: 8px 0 0; padding: 28px; border-radius: 12px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.contact-form fieldset { margin: 0; padding: 0; border: none; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.contact-form legend { width: 100%; margin-bottom: 8px; padding: 0; font-weight: 700; font-size: 15px; color: var(--ink); }
.contact-form fieldset label { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; cursor: pointer; }
.contact-field { display: flex; flex-direction: column; gap: 6px; }
.contact-field-name { font-weight: 700; font-size: 15px; color: var(--ink); }
.contact-form .req, .contact-form .opt { margin-left: 8px; padding: 1px 7px; border-radius: 4px; font-size: 11.5px; font-weight: 700; vertical-align: 1px; }
.contact-form .req { color: #fff; background: var(--amber); }
.contact-form .opt { color: var(--sub); background: #fff; box-shadow: inset 0 0 0 1px var(--line); font-weight: 500; }
.contact-field input, .contact-field textarea { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #c9d0d9; border-radius: 8px; background: #fff; font: inherit; font-size: 15px; color: var(--ink); }
.contact-field textarea { resize: vertical; line-height: 1.7; }
.contact-field input:focus, .contact-field textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(22, 35, 58, .12); }
.contact-field-note { font-size: 13px; color: var(--sub); }
.contact-form .btn { align-self: flex-start; border: none; cursor: pointer; font: inherit; font-weight: 700; }
.contact-form .btn:disabled { opacity: .55; cursor: default; }
.contact-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.contact-status { margin: 0; min-height: 1.5em; font-size: 15px; }
.contact-status.is-ok { color: #1b7a4b; font-weight: 700; }
.contact-status.is-error { color: var(--alert); font-weight: 700; }
.contact-after { font-size: 13.5px; color: var(--sub); }
@media (max-width: 900px) { .contact-form { padding: 20px 16px; } }
