/* ============================================================
   AI実習ナビ ― カスタムスタイル
   ------------------------------------------------------------
   左サイドバーの最上位ナビ項目（ホーム／はじめに／各コース）を
   太字＋落ち着いた青色に統一し、視認性を高める。
   ============================================================ */

/* ライトモード（既定） */
[data-md-color-scheme="default"]
.md-sidebar--primary .md-nav--primary > .md-nav__list > .md-nav__item > .md-nav__link {
  font-weight: 700;
  color: #1e3a8a; /* indigo-900 相当の落ち着いた紺青 */
}

/* ダークモード（slate） */
[data-md-color-scheme="slate"]
.md-sidebar--primary .md-nav--primary > .md-nav__list > .md-nav__item > .md-nav__link {
  font-weight: 700;
  color: #93c5fd; /* blue-300 相当の明るめ青（暗背景で可読） */
}

/* ホバー時：軽く明るくして反応をわかりやすく（ライト） */
[data-md-color-scheme="default"]
.md-sidebar--primary .md-nav--primary > .md-nav__list > .md-nav__item > .md-nav__link:hover {
  color: #2563eb; /* blue-600 */
}

/* ホバー時（ダーク） */
[data-md-color-scheme="slate"]
.md-sidebar--primary .md-nav--primary > .md-nav__list > .md-nav__item > .md-nav__link:hover {
  color: #bfdbfe; /* blue-200 */
}

/* ============================================================
   「できたかチェック」インタラクティブ化のための補助スタイル
   - extra.js で disabled を外し、クリック可能にしている
   - チェック済み項目はラベルをやや薄くして「達成感」を演出
   ============================================================ */

/* 通常時のチェックボックスをクリック可能なカーソルに
   （pymdownx.tasklist + custom_checkbox:true で input は非表示、
     可視部分の label/indicator を pointer にする） */
li.task-list-item input[type="checkbox"],
li.task-list-item .task-list-control,
li.task-list-item .task-list-indicator {
  cursor: pointer;
}

/* チェック済み項目（JSで .task-checked クラスを付与）の文字色を薄く */
li.task-list-item.task-checked {
  color: rgba(0, 0, 0, 0.45);
  text-decoration: line-through;
  text-decoration-color: rgba(0, 0, 0, 0.25);
}

/* ダークモード時のチェック済み項目 */
[data-md-color-scheme="slate"] li.task-list-item.task-checked {
  color: rgba(255, 255, 255, 0.45);
  text-decoration-color: rgba(255, 255, 255, 0.25);
}

/* ============================================================
   サイドバーリンクに付与する完了バッジ
   - extra.js の decorateSidebar() で <span class="task-status-badge">
     を末尾に追加する
   ============================================================ */
.md-sidebar--primary .md-nav__link .task-status-badge {
  display: inline-block;
  margin-left: 0.4em;
  padding: 0 0.35em;
  border-radius: 0.7em;
  font-size: 0.78em;
  font-weight: 700;
  line-height: 1.4;
  color: #ffffff;
  background-color: #16a34a; /* green-600 */
  vertical-align: baseline;
}

/* ダークモード時のバッジ色 */
[data-md-color-scheme="slate"]
.md-sidebar--primary .md-nav__link .task-status-badge {
  background-color: #22c55e; /* green-500（暗背景でも視認しやすく） */
  color: #0b1220;
}

/* ============================================================
   カスタム admonition: bad-example / good-example + prompt / response
   ------------------------------------------------------------
   生成 AI スキル演習の「× 悪い例 / ◯ 良い例」 を OLS 側 (= LessonShow.vue) の
   視覚スタイルに揃えるためのカスタムタイプ群。

   方針:
     - bad-example / good-example: 外枠・背景・アイコンを消し、
       タイトル (= × ... / ◯ ...) を大きめの色付きボールドで表示
     - prompt / response: 内側ボックスとして淡色背景 + 細枠で表示
     - prompt / response の色 は 親が bad-example か good-example かで切替
       (= bad → 淡赤、good → 淡青、Tailwind の bg-red-50 / bg-blue-50 相当)
     - アイコンは全て非表示。タイトルテキスト中の絵文字 (× / ◯ / 👤 / 🤖) のみで識別

   利用例 (= markdown 著者向け):
     !!! bad-example "❌ 悪例：不必要に長いプロンプト"
         !!! prompt "👤 プロンプト"
             ふるさと納税について教えて
         !!! response "🤖 想定レスポンス"
             ふるさと納税とは……

     !!! good-example "✅ 良例：必要な情報を簡潔に伝えるプロンプト"
         !!! prompt "👤 プロンプト"
             ふるさと納税の仕組みを、初心者向けに解説して。
         !!! response "🤖 想定レスポンス"
             ふるさと納税とは、自分の好きな自治体を応援できる……
   ============================================================ */

/* ---- bad-example / good-example: 外枠なし + 大見出しのみ ---- */
.md-typeset .admonition.bad-example,
.md-typeset .admonition.good-example,
.md-typeset details.bad-example,
.md-typeset details.good-example {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
  margin: 1.2em 0 0.8em 0;
}
.md-typeset .bad-example > .admonition-title,
.md-typeset .good-example > .admonition-title,
.md-typeset .bad-example > summary,
.md-typeset .good-example > summary {
  background: transparent;
  border: none;
  padding: 0 0 0.3em 0;
  font-size: 1.25em;
  font-weight: 700;
  line-height: 1.3;
}
.md-typeset .bad-example > .admonition-title,
.md-typeset .bad-example > summary {
  color: #b91c1c; /* red-700 */
}
.md-typeset .good-example > .admonition-title,
.md-typeset .good-example > summary {
  color: #1d4ed8; /* blue-700 */
}
/* アイコンを非表示 */
.md-typeset .bad-example > .admonition-title::before,
.md-typeset .good-example > .admonition-title::before,
.md-typeset .bad-example > summary::before,
.md-typeset .good-example > summary::before {
  display: none;
  content: none;
}

/* ---- 内側 prompt / response 共通: 細枠 + 軽い丸み + コンパクト ---- */
.md-typeset .bad-example .admonition,
.md-typeset .good-example .admonition,
.md-typeset .bad-example details,
.md-typeset .good-example details {
  border-width: 1px;
  border-radius: 0.5em;
  margin: 0.4em 0;
  padding: 0;
  box-shadow: none;
}
/* ラベル (= 「👤 プロンプト」 / 「🤖 想定レスポンス」) と本文の
   左インデントを揃え、アイコン空きスペース (= MkDocs Material 既定 padding-left:2rem)
   を消す。両方 padding-left を同じ値 (= 0.75em) にして OLS 風に左寄せ。 */
.md-typeset .bad-example .admonition > .admonition-title,
.md-typeset .good-example .admonition > .admonition-title,
.md-typeset .bad-example details > summary,
.md-typeset .good-example details > summary {
  font-weight: 700;
  font-size: 0.85em;
  color: #4b5563; /* gray-600 */
  background: transparent;
  padding: 0.5em 0.75em 0.15em 0.75em;
  margin: 0;
}
.md-typeset .bad-example .admonition > p,
.md-typeset .good-example .admonition > p,
.md-typeset .bad-example details > p,
.md-typeset .good-example details > p {
  padding: 0 0.75em 0.5em 0.75em;
  margin: 0;
}
/* 内側 admonition のアイコンも非表示 (= タイトル文字中の 👤 / 🤖 で十分) */
.md-typeset .bad-example .admonition > .admonition-title::before,
.md-typeset .good-example .admonition > .admonition-title::before,
.md-typeset .bad-example details > summary::before,
.md-typeset .good-example details > summary::before {
  display: none;
  content: none;
}

/* ---- bad-example 内の prompt/response: 淡赤背景 (= bg-red-50 / border-red-200) ---- */
.md-typeset .bad-example .admonition.prompt,
.md-typeset .bad-example .admonition.response,
.md-typeset .bad-example details.prompt,
.md-typeset .bad-example details.response {
  border-color: #fecaca; /* red-200 */
  background-color: #fef2f2; /* red-50 */
}

/* ---- good-example 内の prompt/response: 淡青背景 (= bg-blue-50 / border-blue-200) ---- */
.md-typeset .good-example .admonition.prompt,
.md-typeset .good-example .admonition.response,
.md-typeset .good-example details.prompt,
.md-typeset .good-example details.response {
  border-color: #bfdbfe; /* blue-200 */
  background-color: #eff6ff; /* blue-50 */
}

/* ---- ダークモード ---- */
[data-md-color-scheme="slate"] .md-typeset .bad-example > .admonition-title,
[data-md-color-scheme="slate"] .md-typeset .bad-example > summary {
  color: #fca5a5; /* red-300 */
}
[data-md-color-scheme="slate"] .md-typeset .good-example > .admonition-title,
[data-md-color-scheme="slate"] .md-typeset .good-example > summary {
  color: #93c5fd; /* blue-300 */
}
[data-md-color-scheme="slate"] .md-typeset .bad-example .admonition.prompt,
[data-md-color-scheme="slate"] .md-typeset .bad-example .admonition.response,
[data-md-color-scheme="slate"] .md-typeset .bad-example details.prompt,
[data-md-color-scheme="slate"] .md-typeset .bad-example details.response {
  border-color: rgba(239, 68, 68, 0.4);
  background-color: rgba(239, 68, 68, 0.10);
}
[data-md-color-scheme="slate"] .md-typeset .good-example .admonition.prompt,
[data-md-color-scheme="slate"] .md-typeset .good-example .admonition.response,
[data-md-color-scheme="slate"] .md-typeset .good-example details.prompt,
[data-md-color-scheme="slate"] .md-typeset .good-example details.response {
  border-color: rgba(96, 165, 250, 0.4);
  background-color: rgba(96, 165, 250, 0.10);
}
[data-md-color-scheme="slate"] .md-typeset .bad-example .admonition > .admonition-title,
[data-md-color-scheme="slate"] .md-typeset .good-example .admonition > .admonition-title,
[data-md-color-scheme="slate"] .md-typeset .bad-example details > summary,
[data-md-color-scheme="slate"] .md-typeset .good-example details > summary {
  color: #d1d5db; /* gray-300 */
}

/* ============================================================
   カスタム admonition: 🏋 課題セクション用（OLS UI 追従・2026-07-03）
   ------------------------------------------------------------
   OLS 側 (= LessonShow.vue) が実装した課題実行 UI を、passive
   (= MkDocs Material) でも同等の視覚で表示するためのスタイル群。
   passive は read-only のため操作はできないが、レイアウト/色を揃える。

     - task-step   … 番号付きステップ枠（❶❷❸）
     - prompt      … task-step 内の「送信するプロンプト」青系枠
     - hint        … 書き換えのヒント（黄系枠。passive では常時表示）
     - input       … 学習者の記入欄（白枠。JS で無効化 textarea を挿入、
                      key: 等の設定行は隠す。詳細は extra.js）
     - action      … 送信ボタン（青ボタン化。type: 行は非表示）
     - task-reflect… 「AI ヘルパーとふりかえる」CTA（緑系枠）
   ============================================================ */

/* ---- task-step: ステップカード ---- */
.md-typeset .admonition.task-step,
.md-typeset details.task-step {
  border: 1px solid #c7d2fe; /* indigo-200 */
  border-left-width: 4px;
  border-radius: 0.5em;
  background: #fafbff;
  box-shadow: none;
  margin: 1em 0;
}
.md-typeset .task-step > .admonition-title,
.md-typeset .task-step > summary {
  background: #eef2ff; /* indigo-50 */
  color: #3730a3; /* indigo-800 */
  font-weight: 700;
  padding-left: 0.9em;
}
.md-typeset .task-step > .admonition-title::before,
.md-typeset .task-step > summary::before {
  display: none;
  content: none;
}

/* ---- task-step 内 prompt: 青系ボックス（bad/good-example とは別スコープ）---- */
.md-typeset .task-step .admonition.prompt,
.md-typeset .task-step details.prompt {
  border: 1px solid #bfdbfe; /* blue-200 */
  border-radius: 0.5em;
  background: #eff6ff; /* blue-50 */
  box-shadow: none;
  margin: 0.5em 0;
  padding: 0;
}
.md-typeset .task-step .admonition.prompt > .admonition-title,
.md-typeset .task-step details.prompt > summary {
  background: transparent;
  color: #1e40af; /* blue-800 */
  font-weight: 700;
  font-size: 0.85em;
  padding: 0.5em 0.75em 0.15em 0.75em;
}
.md-typeset .task-step .admonition.prompt > .admonition-title::before,
.md-typeset .task-step details.prompt > summary::before {
  display: none;
  content: none;
}
.md-typeset .task-step .admonition.prompt > p {
  padding: 0 0.75em 0.5em 0.75em;
  margin: 0;
}

/* ---- hint: 黄系ボックス（passive では常時表示）---- */
.md-typeset .admonition.hint,
.md-typeset details.hint {
  border: 1px solid #fde68a; /* amber-200 */
  border-radius: 0.5em;
  background: #fffbeb; /* amber-50 */
  box-shadow: none;
  margin: 0.5em 0;
}
.md-typeset .hint > .admonition-title,
.md-typeset .hint > summary {
  background: transparent;
  color: #92400e; /* amber-800 */
  font-weight: 700;
  font-size: 0.85em;
}
.md-typeset .hint > .admonition-title::before,
.md-typeset .hint > summary::before {
  display: none;
  content: none;
}

/* ---- input: 記入欄（白枠）。JS が無効化 textarea を挿入 ---- */
.md-typeset .admonition.input,
.md-typeset details.input {
  border: 1px solid #d1d5db; /* gray-300 */
  border-radius: 0.5em;
  background: #ffffff;
  box-shadow: none;
  margin: 0.5em 0;
  padding: 0; /* MkDocs 既定パディングを消し、① prompt 枠と左位置を揃える */
}
.md-typeset .input > .admonition-title,
.md-typeset .input > summary {
  background: transparent;
  color: #374151; /* gray-700 */
  font-weight: 700;
  font-size: 0.85em;
  padding: 0.5em 0.75em 0.15em 0.75em; /* 既定の 2rem 左パディングをリセット */
}
.md-typeset .input > .admonition-title::before,
.md-typeset .input > summary::before {
  display: none;
  content: none;
}
.md-typeset .input textarea.passive-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 3.2em;
  margin: 0 0 0.6em; /* 枠幅いっぱいに。テキストは padding-left で ① 本文と同じ 0.75em に */
  padding: 0.45em 0.65em 0.45em 0.75em;
  border: 1px dashed #cbd5e1; /* slate-300 */
  border-radius: 0.4em;
  background: #f8fafc; /* slate-50 */
  color: #111827; /* gray-900: 自分が入力した文字ははっきり濃く表示 */
  font-family: inherit;
  font-size: 1em; /* 例題プロンプト本文と同じ大きさに揃える */
  font-weight: 500;
  resize: vertical;
}
/* プレースホルダー（例文）は薄く。入力文字との違いを一目で分かるように */
.md-typeset .input textarea.passive-input::placeholder {
  color: #94a3b8; /* slate-400 */
  font-weight: 400;
  opacity: 1;
}

/* プロンプト例のコードブロック（```text）は、横スクロールさせず入力欄の
   右端で折り返して全文を表示する。長いプロンプト文でも一目で読めるように。 */
.md-typeset pre > code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
/* 記入欄（textarea）も同様に、右端で折り返して表示する（既定挙動の明示） */
.md-typeset .input textarea.passive-input {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* 「💡 使うスキル」（??? skill）は、JS でタイトル右上のボタンに集約する
   （enhanceHints が summary を隠しボタン化）。開くと下に復習パネルを表示。 */
.md-typeset details.skill {
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
  margin: 0.3em 0 0.2em;
  font-size: inherit;
}
.md-typeset details.skill[open] {
  background: #f5f7ff;
  border: 1px solid #e0e7ff;
  border-radius: 0.4em;
  padding: 0.5em 0.85em;
  margin: 0.4em 0 0.6em;
}
.md-typeset details.skill > ul { margin: 0.2em 0 0; }
[data-md-color-scheme="slate"] .md-typeset details.skill[open] {
  background: #1e1b4b;
  border-color: #3730a3;
}

/* ---- action: 送信ボタン化（type: 行は非表示）---- */
.md-typeset .admonition.action,
.md-typeset details.action {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
  margin: 0.5em 0;
}
/* passive では送信不可のため action 見出しボタンは隠し、説明文のみ表示。
   コピー操作は対象文字列（prompt / input）側のボタンに集約する。 */
.md-typeset .action > .admonition-title,
.md-typeset .action > summary {
  display: none;
}
/* 「type: send-to-gemini」 等の設定行を隠す（コピー説明文は除外） */
.md-typeset .action > p:not(.passive-copy-note) {
  display: none;
}
.md-typeset .action > p.passive-copy-note {
  display: block;
  margin: 0.2em 0 0;
  font-size: 0.8em;
  color: #64748b; /* slate-500 */
}
[data-md-color-scheme="slate"] .md-typeset .action > p.passive-copy-note {
  color: #94a3b8; /* slate-400 */
}

/* ---- 対象文字列（prompt / input）右上のコピーボタン ---- */
.md-typeset .admonition.prompt.has-copy-btn,
.md-typeset .admonition.input.has-copy-btn {
  position: relative;
}
/* ボタンと重ならないよう見出しに右余白を確保 */
.md-typeset .admonition.prompt.has-copy-btn > .admonition-title,
.md-typeset .admonition.input.has-copy-btn > .admonition-title {
  padding-right: 6em;
}
.md-typeset button.passive-copy-btn {
  position: absolute;
  top: 0.4em;
  right: 0.4em;
  z-index: 1;
  background: #2563eb; /* blue-600 */
  color: #ffffff;
  font-weight: 700;
  font-size: 0.72em;
  line-height: 1.2;
  padding: 0.3em 0.6em;
  border: none;
  border-radius: 0.4em;
  cursor: pointer;
  user-select: none;
}
.md-typeset button.passive-copy-btn:hover {
  background: #1d4ed8; /* blue-700 */
}
.md-typeset button.passive-copy-btn.copied {
  background: #16a34a; /* green-600（コピー完了） */
}

/* ---- task-reflect: passive では ❹ ステップ（①〜③と同じ体裁）---- */
.md-typeset .admonition.task-reflect,
.md-typeset details.task-reflect {
  border: 1px solid #c7d2fe; /* indigo-200 */
  border-left-width: 4px;
  border-radius: 0.5em;
  background: #fafbff;
  box-shadow: none;
  margin: 1em 0;
}
.md-typeset .task-reflect > .admonition-title,
.md-typeset .task-reflect > summary {
  background: #eef2ff; /* indigo-50 */
  color: #3730a3; /* indigo-800 */
  font-weight: 700;
  padding-left: 0.9em;
}
.md-typeset .task-reflect > .admonition-title::before,
.md-typeset .task-reflect > summary::before {
  display: none;
  content: none;
}
/* 👤 ふりかえり用プロンプト枠（①の prompt 枠と同じ青系）*/
.md-typeset .reflect-prompt-box {
  border: 1px solid #bfdbfe; /* blue-200 */
  border-radius: 0.5em;
  background: #eff6ff; /* blue-50 */
  box-shadow: none;
  margin: 0.5em 0; /* 左右0で ①(prompt枠) とバッジ・本文の左位置を揃える */
  padding: 0;
}
.md-typeset .reflect-prompt-box > .admonition-title {
  background: transparent;
  color: #1e40af; /* blue-800 */
  font-weight: 700;
  font-size: 0.85em;
  padding: 0.5em 0.75em 0.15em 0.75em;
}
.md-typeset .reflect-prompt-box.has-copy-btn > .admonition-title {
  padding-right: 6em;
}
/* admonition 既定アイコン(鉛筆)の ::before を抑制（①②と同じ扱い。
   これが無いとアイコンが「👤 ふりかえり用プロンプト」の文字に重なる）*/
.md-typeset .reflect-prompt-box > .admonition-title::before {
  display: none;
  content: none;
}
.md-typeset .reflect-prompt-box > p {
  padding: 0 0.75em 0.6em 0.75em;
  margin: 0;
  color: #334155; /* slate-700 */
  font-size: 0.9em;
}
.md-typeset .task-reflect .passive-copy-note.reflect-note {
  display: block;
  margin: 0.1em 0.5em 0.6em;
  font-size: 0.8em;
  color: #64748b; /* slate-500 */
}

/* ---- ダークモード（slate）---- */
[data-md-color-scheme="slate"] .md-typeset .admonition.task-step {
  border-color: rgba(129, 140, 248, 0.45);
  background: rgba(99, 102, 241, 0.08);
}
[data-md-color-scheme="slate"] .md-typeset .task-step > .admonition-title {
  background: rgba(99, 102, 241, 0.18);
  color: #c7d2fe;
}
[data-md-color-scheme="slate"] .md-typeset .task-step .admonition.prompt {
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(96, 165, 250, 0.10);
}
[data-md-color-scheme="slate"] .md-typeset .task-step .admonition.prompt > .admonition-title {
  color: #93c5fd;
}
[data-md-color-scheme="slate"] .md-typeset .admonition.hint {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.10);
}
[data-md-color-scheme="slate"] .md-typeset .hint > .admonition-title {
  color: #fcd34d;
}
[data-md-color-scheme="slate"] .md-typeset .admonition.input {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(148, 163, 184, 0.06);
}
[data-md-color-scheme="slate"] .md-typeset .input > .admonition-title {
  color: #e5e7eb;
}
[data-md-color-scheme="slate"] .md-typeset .input textarea.passive-input {
  border-color: rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.4);
  color: #f8fafc; /* 入力文字は明るくはっきり */
}
[data-md-color-scheme="slate"]
  .md-typeset
  .input
  textarea.passive-input::placeholder {
  color: #64748b; /* 例文は暗めで区別 */
  opacity: 1;
}
[data-md-color-scheme="slate"] .md-typeset .admonition.task-reflect {
  border-color: rgba(129, 140, 248, 0.45); /* indigo（①〜③と同じ）*/
  background: rgba(99, 102, 241, 0.08);
}
[data-md-color-scheme="slate"] .md-typeset .task-reflect > .admonition-title {
  background: rgba(99, 102, 241, 0.18);
  color: #c7d2fe;
}
[data-md-color-scheme="slate"] .md-typeset .reflect-prompt-box {
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(96, 165, 250, 0.10);
}
[data-md-color-scheme="slate"] .md-typeset .reflect-prompt-box > .admonition-title {
  color: #93c5fd;
}
[data-md-color-scheme="slate"] .md-typeset .reflect-prompt-box > p {
  color: #cbd5e1; /* slate-300（暗背景で可読）*/
}

/* ---- hint 開閉（task-step 内・見出し右のボタンでトグル）---- */
.md-typeset .task-step > .admonition.hint {
  display: none; /* 既定は非表示。JS が付けるボタンで開閉 */
}
.md-typeset .task-step > .admonition.hint.hint-open {
  display: block;
}
/* ステップ右上のボタン群（使うスキル＝左／頼み方の例＝右）を横並びに */
.md-typeset .task-step > .admonition-title.has-step-btns {
  position: relative;
  padding-right: 8.5em; /* ボタン1つぶん */
}
.md-typeset .task-step > .admonition-title.has-step-btns.has-two-btns {
  padding-right: 15.5em; /* ボタン2つぶん */
}
.md-typeset .step-btns {
  position: absolute;
  top: 50%;
  right: 0.5em;
  transform: translateY(-50%);
  display: flex;
  gap: 0.4em;
}
.md-typeset button.step-btn {
  color: #ffffff;
  font-weight: 700;
  font-size: 0.72em;
  line-height: 1.2;
  padding: 0.3em 0.7em;
  border: none;
  border-radius: 0.4em;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.md-typeset button.hint-btn { background: #b45309; }        /* amber-700 濃いめで白文字を読みやすく */
.md-typeset button.hint-btn:hover { background: #92400e; }  /* amber-800 */
.md-typeset button.skill-btn { background: #4f46e5; }       /* indigo-600（amberとバランス） */
.md-typeset button.skill-btn:hover { background: #4338ca; } /* indigo-700 */

/* 実務実践課題のステップ見出しは「❶」→「ステップ1」の文字バッジに（JSで置換） */
.md-typeset .task-step > .admonition-title .step-badge {
  display: inline-block;
  background: #1d4ed8; /* blue-700 */
  color: #ffffff;
  font-size: 0.72em;
  font-weight: 700;
  line-height: 1.35;
  padding: 0.12em 0.6em;
  border-radius: 0.35em;
  margin-right: 0.5em;
  vertical-align: middle;
}

/* 左ナビの演習名につく補足説明（（…））は、名前の下に小さめ・灰色・非ボールドで */
.md-sidebar--primary .md-nav__item--section > .md-nav__link .md-ellipsis .sec-note {
  display: block;
  font-size: 0.8em;
  font-weight: 400;
  color: #94a3b8; /* slate-400 */
  line-height: 1.25;
  margin-top: 0.1em;
}

/* ---- 課題ページ上部の所属演習ラベル ---- */
.md-typeset .exercise-label,
.exercise-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b; /* slate-500 */
  letter-spacing: 0.02em;
  margin: 0 0 0.2rem;
}

/* ---- 添付（追加）プロンプト：本文冒頭の「ファイルを追加」チップ ---- */
.md-typeset .admonition.prompt .attach-note {
  display: block;
  width: fit-content;
  /* 本文<p>は padding-left:0.6rem で内側にあるため、チップも本文pの左padding(0.75em=0.48rem)と同量ずらし、本文テキストと左端を揃える */
  margin: 0 0 0.5em 0.48rem;
  padding: 0.25em 0.55em;
  background: #eef3f8; /* 青灰・淡 */
  border: 2px solid #b7c7dc;
  border-radius: 6px;
  color: #3f5573; /* 落ち着いた青灰 */
  font-weight: 600;
  font-size: 0.85em;
}

/* ---- スクロール時ヘッダー：課題名の左に「演習名／課題N」を小さく2段表示 ---- */
.md-header__title .hdr-lesson-badge {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  vertical-align: middle;
  margin-right: 0.55rem;
  padding-right: 0.55rem;
  border-right: 1px solid rgba(255, 255, 255, 0.45);
  line-height: 1.12;
  font-size: 0.62rem;
  font-weight: 600;
  white-space: nowrap;
}
.md-header__title .hdr-lesson-badge__ex {
  opacity: 0.9;
}

/* ---- task-reflect: ふりかえりプロンプトのコピーボタン（passive）---- */
.md-typeset button.reflect-copy-btn {
  display: inline-block;
  margin: 0.6em 0 0.2em;
  background: #059669; /* emerald-600 */
  color: #ffffff;
  font-weight: 700;
  font-size: 0.8em;
  padding: 0.45em 0.9em;
  border: none;
  border-radius: 0.5em;
  cursor: pointer;
  user-select: none;
}
.md-typeset button.reflect-copy-btn:hover {
  background: #047857; /* emerald-700 */
}
.md-typeset button.reflect-copy-btn.copied {
  background: #16a34a; /* green-600 */
}

/* ============================================================
   本文・項目名（見出し）のフォントサイズ調整
   ------------------------------------------------------------
   - 本文（トップレベルの段落・リスト）を左サイドバー(.md-nav=0.7rem)と
     同じサイズに揃える。
   - 項目名(H2: 🎯スキル概要 / 🧪例題 / 💡解説 / 🏋課題)を一回り小さくし、
     本文とのバランスを整える。
   - admonition 内部（prompt/response/hint/input 等）は対象外（> で限定）。
   ============================================================ */
.md-typeset > p,
.md-typeset > ul,
.md-typeset > ol,
/* markdown="1" の div で囲んだ場合も、直下と同じ本文サイズに揃える
   （囲まないと > 指定から外れて 0.8rem のままになり、他と大きさがずれる） */
.md-typeset > .points-list > p,
.md-typeset > .points-list > ul,
.md-typeset > .points-list > ol {
  font-size: 0.7rem;
}
/* 右側の目次(TOC)パネルは表示しない（Material の :not([hidden]) を上書き）。
   余白回収は extra.js の hideSecondaryToc()（hidden属性付与）で行う。 */
.md-sidebar--secondary {
  display: none !important;
}

/* 左サイドバー表示/非表示トグルボタン。≥60em（カラム表示時）に表示し、
   <60em はドロワー用ハンバーガーが担うため出さない。 */
.md-header__button.nav-toggle-btn {
  display: none;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
@media screen and (min-width: 60em) {
  .md-header__button.nav-toggle-btn {
    display: inline-block;
  }
}
/* 非表示状態: 左ナビを隠す。本文は左端に近すぎないよう自然な左余白を確保 */
body.nav-collapsed .md-sidebar--primary {
  display: none !important;
}
body.nav-collapsed .md-content > .md-content__inner {
  margin-left: 2rem !important;
}

/* 狭幅ドロワー時（<60em・左ナビが隠れる）も本文左端に近すぎないよう左余白を少し確保 */
@media screen and (max-width: 59.9375em) {
  .md-content__inner {
    margin-left: 2rem;
  }
}

/* ============================================================
   左ナビ: 課題の実行済みマーク(クリックでトグル) + 演習(セクション)の
   折りたたみボタン + 進捗(n/m)。実装は extra.js（localStorage 保存）。
   ============================================================ */
.md-sidebar--primary .md-nav__item.has-marks {
  position: relative;
}
.md-sidebar--primary .md-nav__item.has-marks > .md-nav__link {
  padding-right: 1.5em; /* 右の状態マーク1つと重ならない余白 */
}
.md-sidebar--primary .lesson-marks {
  position: absolute;
  top: 0.1em;
  right: 0.12em;
  z-index: 2;
  display: flex;
  gap: 0.08em;
}
.md-sidebar--primary .lesson-mark {
  width: 1.2em;
  height: 1.2em;
  line-height: 1.2em;
  text-align: center;
  font-size: 0.82rem;
  cursor: default;
  user-select: none;
  color: #cbd5e1; /* 未設定: 薄いグレー */
  opacity: 0.45;
}
.md-sidebar--primary .lesson-mark.is-on {
  opacity: 1;
  font-weight: 700;
  text-shadow: 0 0 2px currentColor; /* 設定済みは目立たせる */
}
/* 1マークで4状態を表す：✔青＝実践中(CP1)／✔緑＝確認済(CP2)／★琥珀＝課題済／ー＝未実施 */
.md-sidebar--primary .lesson-mark.is-practice {
  color: #2563eb; /* 青 = 実践中 */
}
.md-sidebar--primary .lesson-mark.is-check {
  color: #16a34a; /* 緑 = 確認済 */
}
.md-sidebar--primary .lesson-mark.is-comp {
  color: #d97706; /* 琥珀 = 課題済（★） */
}
/* 未実施（ー）は「まだ何もしていない」ことが分かる無効表示にする */
.md-sidebar--primary .lesson-mark.is-none {
  color: #cbd5e1;
  opacity: 0.5;
  font-weight: 400;
  text-shadow: none;
}
/* 演習(セクション)見出しの 折りたたみトグル と 進捗バッジ */
/* Material は section 見出しラベルを pointer-events:none にしてクリック不能に
   するため、行全体を押して開閉できるよう auto に戻す（これが無いと反応しない）。 */
.md-sidebar--primary .md-nav__item--section > .md-nav__link {
  pointer-events: auto !important;
  cursor: pointer;
}
/* 見出しの行全体をクリック可能なボタンとして扱う */
.md-sidebar--primary .md-nav__link.sec-toggleable {
  cursor: pointer;
  border-radius: 0.3em;
  transition: background 0.12s;
}
.md-sidebar--primary .md-nav__link.sec-toggleable:hover {
  background: rgba(30, 58, 138, 0.06);
}
.md-sidebar--primary .sec-toggle {
  pointer-events: none; /* クリックは行(sec-toggleable)側で受ける */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3em;
  height: 1.3em;
  margin-right: 0.3em;
  border-radius: 0.25em;
  background: #e2e8f0; /* ボタンらしく背景をつける */
  color: #475569;
  font-size: 0.8em;
  vertical-align: middle;
  user-select: none;
}
.md-sidebar--primary .md-nav__link.sec-toggleable:hover .sec-toggle {
  background: #cbd5e1;
}
.md-sidebar--primary .sec-count {
  pointer-events: none;
  margin-left: 0.4em;
  font-size: 0.85em;
  font-weight: 400;
  color: #94a3b8;
  white-space: nowrap;
}
.md-sidebar--primary .sec-count.all-done {
  color: #16a34a;
  font-weight: 700;
}
/* 完了した演習は、見出し行にも左の緑アクセントを付けて一目で分かるように */
.md-sidebar--primary .md-nav__item--section.sec-all-done > .md-nav__link {
  box-shadow: inset 0.2em 0 0 #16a34a;
}
[data-md-color-scheme="slate"] .md-sidebar--primary .sec-toggle {
  background: rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
}
[data-md-color-scheme="slate"]
  .md-sidebar--primary
  .md-nav__link.sec-toggleable:hover {
  background: rgba(148, 163, 184, 0.12);
}
/* カスタムのセクション折りたたみは ≥60em(カラム表示)のみ。
   ドロワー(<60em)では Material のネイティブ開閉に任せるため適用しない
   （<60em で適用すると、開いたはずのサブリストを display:none で隠してしまう）。 */
@media screen and (min-width: 60em) {
  .md-sidebar--primary .md-nav__item--section.sec-collapsed > .md-nav {
    display: none !important;
  }
  /* 独自トグル(.sec-toggle)を使うため、Material ネイティブのセクション矢印は隠す。
     ドロワーでは矢印を残してアコーディオンの開閉が分かるようにする。 */
  .md-sidebar--primary .md-nav__item--section > .md-nav__link > .md-nav__icon {
    display: none;
  }
}
/* ダークモード */
[data-md-color-scheme="slate"] .md-sidebar--primary .lesson-mark {
  color: #475569;
}
[data-md-color-scheme="slate"] .md-sidebar--primary .lesson-mark.is-practice {
  color: #60a5fa;
}
[data-md-color-scheme="slate"] .md-sidebar--primary .lesson-mark.is-check {
  color: #22c55e;
}
[data-md-color-scheme="slate"] .md-sidebar--primary .lesson-mark.is-comp {
  color: #fbbf24;
}
[data-md-color-scheme="slate"] .md-sidebar--primary .lesson-mark.is-none {
  color: #475569;
}
[data-md-color-scheme="slate"] .md-sidebar--primary .sec-count {
  color: #64748b;
}
[data-md-color-scheme="slate"] .md-sidebar--primary .sec-count.all-done {
  color: #22c55e;
}

/* ============================================================
   「AI実習ナビ」横の達成度グラフ（完了=緑／確認=青の積み上げバー＋件数）
   ============================================================ */
.md-sidebar--primary .md-nav--primary > .md-nav__title {
  overflow: visible; /* 下にグラフを出すため */
  /* 上部ブロックを縦積みにし、順序を order で制御：
     使用AI（1）→ 実施状況グラフ（2）→ 実習コンテンツ:（3・イントロの直前） */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  /* 固定せず、課題リストと一緒にスクロールさせる（sticky を打ち消す） */
  position: static;
  box-shadow: none;
}
/* サイドバーのタイトル内ロゴは非表示（ヘッダーに同じロゴがあるため） */
.md-sidebar--primary .md-nav--primary > .md-nav__title > .md-logo {
  display: none;
}
.md-sidebar--primary .md-nav--primary > .md-nav__title > .ai-selector {
  order: 1;
}
.md-sidebar--primary .md-nav--primary > .md-nav__title > .nav-progress-graph {
  order: 2;
}
.md-sidebar--primary .md-nav--primary > .md-nav__title > .nav-content-label {
  order: 3;
}
/* 「実習コンテンツ:」ラベル（旧サイト名の置き換え。イントロの直前に配置） */
.md-sidebar--primary .nav-content-label {
  display: block;
  margin: 0.5em 0.3em 0.1em;
  padding-top: 0.5em;
  border-top: 1px solid var(--md-default-fg-color--lightest); /* 上に区切り線 */
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--md-default-fg-color--light);
}
/* 「実施状況:」ラベル */
.md-sidebar--primary .npg-label {
  padding-top: 0.5em;
  border-top: 1px solid var(--md-default-fg-color--lightest); /* 上に区切り線 */
  font-size: 0.62rem;
  color: #64748b;
  margin-bottom: 0.2em;
}
[data-md-color-scheme="slate"] .md-sidebar--primary .npg-label {
  color: #94a3b8;
}
/* 真のドロワー（<60em オフキャンバス）対策：
   Material はドロワーのタイトルを height:5.6rem 固定にするため、
   そこへ差し込んだ進捗グラフ／AI選択がはみ出してナビ一覧に重なる。
   タイトルを可変高にし、差し込み要素の分だけ一覧を下へ流す。
   （60〜76em 帯は別ブロックで既に可変高化済み） */
@media screen and (max-width: 59.9375em) {
  .md-sidebar--primary .md-nav--primary > .md-nav__title {
    height: auto;
    /* Material の青いドロワーヘッダ(原色背景・白文字・高さ5.6rem)を打ち消す。
       白背景＋濃色にして、上部ブロックの灰色ラベルを読めるようにする。 */
    background: var(--md-default-bg-color);
    color: var(--md-default-fg-color--light);
    box-shadow: none;
    /* 高い青ヘッダの余白を詰める（間延び対策） */
    padding: 0.6rem 0.4rem 0.5rem;
    /* ドロワーは字が大きめ(0.8rem)で em マージンが広がり間延びするため詰める */
    font-size: 0.7rem;
    /* Material はドロワーで line-height:48px を当てるため各ラベルが極端に高くなる。
       通常値に戻して間延びを解消する（これが間延びの主因）。 */
    line-height: 1.4;
  }
  /* 各ラベル/ボタンにも line-height を明示（48px の継承・個別指定を打ち消す） */
  .md-sidebar--primary .md-nav--primary > .md-nav__title .ai-sel-label,
  .md-sidebar--primary .md-nav--primary > .md-nav__title .ai-sel-btn,
  .md-sidebar--primary .md-nav--primary > .md-nav__title .npg-label,
  .md-sidebar--primary .md-nav--primary > .md-nav__title .npg-legend,
  .md-sidebar--primary .md-nav--primary > .md-nav__title > .nav-content-label {
    line-height: 1.3;
  }
  /* 上部ブロック内の各ラベルの上下余白も詰める */
  .md-sidebar--primary .md-nav--primary > .md-nav__title > .nav-content-label,
  .md-sidebar--primary .md-nav--primary > .md-nav__title .npg-label {
    padding-top: 0.35em;
    margin-bottom: 0.1em;
  }
  .md-sidebar--primary .md-nav--primary > .md-nav__title > .nav-progress-graph {
    margin: 0.25em 0.3em 0.1em;
  }
}
.md-sidebar--primary .nav-progress-graph {
  margin: 0.4em 0.3em 0.1em;
  font-weight: 400;
}
.md-sidebar--primary .npg-bar {
  display: flex;
  height: 0.5em;
  border-radius: 0.25em;
  overflow: hidden;
  background: #e2e8f0;
}
.md-sidebar--primary .npg-practice {
  background: #2563eb; /* 青 = 実践中 */
  height: 100%;
  transition: width 0.35s;
}
.md-sidebar--primary .npg-check {
  background: #16a34a; /* 緑 = 確認済 */
  height: 100%;
  transition: width 0.35s;
}
.md-sidebar--primary .npg-comp {
  background: #d97706; /* 琥珀 = 実施済 */
  height: 100%;
  transition: width 0.35s;
}
.md-sidebar--primary .npg-legend {
  margin-top: 0.2em;
  font-size: 0.62rem;
  color: #64748b;
  display: flex;
  gap: 0.5em;
  flex-wrap: wrap;
}
.md-sidebar--primary .npg-l-practice {
  color: #2563eb;
  font-weight: 700;
}
.md-sidebar--primary .npg-l-check {
  color: #16a34a;
  font-weight: 700;
}
.md-sidebar--primary .npg-l-comp {
  color: #d97706;
  font-weight: 700;
}
[data-md-color-scheme="slate"] .md-sidebar--primary .npg-bar {
  background: rgba(148, 163, 184, 0.25);
}
[data-md-color-scheme="slate"] .md-sidebar--primary .npg-l-practice {
  color: #60a5fa;
}
[data-md-color-scheme="slate"] .md-sidebar--primary .npg-l-check {
  color: #22c55e;
}
[data-md-color-scheme="slate"] .md-sidebar--primary .npg-l-comp {
  color: #fbbf24;
}

/* ---- チェックポイント（ユーザが操作する場所と一目で分かるカード）---- */
/* チェックポイントは教材コンテンツではなく「進行の分岐を示すメタ表示」。
   良例/悪例/プロンプト等の admonition が持つ特徴（角丸・色面・カード）を
   すべて捨て、角ばった無彩色の「帯」にして造形を完全に分離する。
   色は状態識別のためバッジとボタンにのみ残す（左ペインの ✔青/✔緑 と対応）。 */
.md-typeset .checkpoint {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8em;
  margin: 2em 0;
  padding: 0.7em 0.9em;
  border: none;
  border-top: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
  border-radius: 0; /* 角丸なし＝コンテンツのカードと明確に別種 */
  /* 無彩色の地。コンテンツ側の色付きカード（青/赤/緑）と競合せず、
     「機構・UIの領域」として読ませる */
  background: #f1f5f9; /* slate-100 */
}
.md-typeset .checkpoint .cp-badge {
  flex: none;
  padding: 0.25em 0.6em;
  border-radius: 0; /* 角ばった矩形 */
  /* バッジは説明文より一段小さく、字間を広げて機械的なラベルに見せる */
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #fff;
  white-space: nowrap;
}
.md-typeset .checkpoint .cp-q {
  flex: 1 1 15em;
  margin: 0;
  font-size: 0.7rem; /* 本文 p と同じ 14px に揃える */
  line-height: 1.55;
  color: #475569; /* 本文より一段落ち着かせる＝地の文ではない */
}
.md-typeset .checkpoint .cp-btn {
  flex: none;
  display: inline-block;
  padding: 0.45em 0.95em;
  /* ボタンはサイト内の他のボタン（次へゆく／AIウィンドウ起動）と同じ角丸に統一。
     バッジ側は角ばったままにして「メタ表示」の印象は保つ。 */
  border-radius: 0.5em;
  font-size: 0.7rem; /* 「次へゆく」ボタン（本文継承 14px）と同じ */
  font-weight: 700;
  color: #fff !important;
  text-decoration: none;
  white-space: nowrap;
}
.md-typeset .checkpoint .cp-btn:hover {
  filter: brightness(1.12);
}
/* CP1＝青（実践中）／CP2＝緑（確認済）。色はバッジとボタンのみ */
.md-typeset .checkpoint.cp1 .cp-badge,
.md-typeset .checkpoint.cp1 .cp-btn {
  background: #2563eb;
}
.md-typeset .checkpoint.cp2 .cp-badge,
.md-typeset .checkpoint.cp2 .cp-btn {
  background: #16a34a;
}
[data-md-color-scheme="slate"] .md-typeset .checkpoint {
  border-top-color: #475569;
  border-bottom-color: #475569;
  background: rgba(255, 255, 255, 0.06); /* 暗背景では白の薄いかぶせで同じ効果を出す */
}
[data-md-color-scheme="slate"] .md-typeset .checkpoint .cp-q {
  color: #cbd5e1;
}
[data-md-color-scheme="slate"] .md-typeset .checkpoint.cp1 .cp-badge,
[data-md-color-scheme="slate"] .md-typeset .checkpoint.cp1 .cp-btn {
  background: #3b82f6;
}
[data-md-color-scheme="slate"] .md-typeset .checkpoint.cp2 .cp-badge,
[data-md-color-scheme="slate"] .md-typeset .checkpoint.cp2 .cp-btn {
  background: #22c55e;
}

/* ============================================================
   演習コンプリートのお祝いトースト
   ============================================================ */
.congrats-toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translate(-50%, 40px);
  background: linear-gradient(135deg, #fef9c3, #bbf7d0);
  color: #166534;
  border: 2px solid #16a34a;
  border-radius: 0.9rem;
  padding: 0.9em 1.6em;
  font-size: 1rem;
  line-height: 1.55;
  text-align: center;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.22);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.4s, transform 0.4s;
  pointer-events: none;
  max-width: 90vw;
}
.congrats-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
[data-md-color-scheme="slate"] .congrats-toast {
  background: linear-gradient(135deg, #3f3f1a, #14532d);
  color: #bbf7d0;
  border-color: #22c55e;
}

/* 左ナビの折り畳み境界を 60em(≈960px) まで下げる。
   Material はドロワー化を @media (max-width:76.234em) で行うため、
   60em〜76.234em の区間だけドロワー挙動を打ち消し、カラム表示を再現する
   （<60em のドロワー、≥76.25em の既存カラム表示には影響させない）。 */
@media screen and (min-width: 60em) and (max-width: 76.234375em) {
  /* sidebar: ドロワー(fixed/off-canvas) → 静的 sticky カラムへ */
  .md-sidebar--primary {
    position: sticky;
    top: 2.4rem;
    left: 0;
    height: auto;
    width: 12.1rem;
    transform: none;
    z-index: auto;
    box-shadow: none;
    background-color: transparent;
    align-self: flex-start;
    flex-shrink: 0;
    padding: 1.2rem 0;
  }
  [data-md-toggle="drawer"]:checked ~ .md-container .md-sidebar--primary {
    transform: none;
    box-shadow: none;
  }
  .md-sidebar--primary .md-sidebar__scrollwrap {
    position: static;
    overflow: visible;
  }
  /* ハンバーガー・オーバーレイ・ドロワーヘッダを無効化 */
  .md-header__button[for="__drawer"] {
    display: none;
  }
  /* ドロワー幅で隠れるヘッダーのロゴを、幅広と同様に表示 */
  .md-header__button.md-logo {
    display: inline-block;
  }
  .md-overlay {
    display: none;
  }

  /* nav: ドロワーの absolute パネル → 静的インライン（≥76.25em相当）*/
  .md-nav--primary,
  .md-nav--primary .md-nav {
    position: static;
    height: auto;
    background-color: transparent;
  }
  /* 左パネル上部のサイトタイトル(「AI実習ナビ」)を幅広と同じ小型sticky表示に。
     ドロワーの大型ヘッダ(height:5.6rem/背景/戻り矢印/ロゴ/[for=__drawer]原色) を打ち消す。 */
  .md-nav--primary .md-nav__title,
  .md-nav--primary .md-nav__title[for="__drawer"] {
    background: transparent;
    background-color: transparent;
    box-shadow: none;
    color: var(--md-default-fg-color--light);
    position: static; /* 固定せず、課題リストと一緒にスクロール */
    height: auto;
    line-height: 1.3;
    padding: 0 0.6rem;
    cursor: auto;
    font-weight: 700;
  }
  .md-nav--primary .md-nav__title .md-nav__icon,
  .md-nav--primary .md-nav__title .md-logo {
    display: none;
  }
  .md-nav--primary .md-nav__title ~ .md-nav__list {
    box-shadow: none;
    overflow: visible;
  }
  [dir="ltr"] .md-nav--primary .md-nav__list {
    padding-left: 0.6rem;
  }
  .md-nav--primary .md-nav__list {
    padding-bottom: 0.4rem;
  }
  [dir="ltr"] .md-nav--primary .md-nav__item > .md-nav__link {
    margin-right: 0.4rem;
  }
  /* ナビ文字サイズ・リンク余白を幅広(≥76.25em)と同一に
     （ドロワー用の大きめ余白 .6rem .8rem / margin-top:0 を打ち消す）*/
  .md-nav {
    font-size: 0.62rem;
    line-height: 1.3;
  }
  /* ドロワー用の .md-nav__item/.md-nav__title{font-size:.8rem} を
     全幅共通の .62rem に合わせる（中間幅で文字が大きくなる主因の解消）*/
  .md-nav--primary .md-nav__item,
  .md-nav--primary .md-nav__title {
    font-size: 0.62rem;
    line-height: 1.3;
  }
  .md-nav--primary .md-nav__link {
    margin-top: 0.625em;
    padding: 0;
  }

  /* 折りたたみナビの展開制御（≥76.25em相当）*/
  .md-nav__toggle ~ .md-nav {
    display: grid;
    grid-template-rows: minmax(0.4rem, 0fr);
    opacity: 0;
    transform: none;
    visibility: collapse;
    transition: none;
  }
  .md-nav__toggle ~ .md-nav > .md-nav__list {
    overflow: hidden;
  }
  .md-nav__item--section {
    display: block;
    margin: 1.25em 0;
  }
  .md-nav__item--section > .md-nav__link {
    font-weight: 700;
  }
  .md-nav__item--section > .md-nav__link:not(.md-nav__container) {
    pointer-events: none;
  }
  .md-nav__item--section > .md-nav__link .md-icon,
  .md-nav__item--section > .md-nav__link > [for] {
    display: none;
  }
  .md-nav__item--section > .md-nav {
    display: block;
    opacity: 1;
    visibility: visible;
  }
  .md-nav__item--section > .md-nav > .md-nav__list > .md-nav__item {
    padding: 0;
  }
  .md-nav__item--nested > .md-nav > .md-nav__title {
    display: none;
  }

  /* 本文の左マージン（ナビ幅分）*/
  [dir="ltr"] .md-sidebar--primary:not([hidden]) ~ .md-content > .md-content__inner {
    margin-left: 1.2rem;
  }
}

/* passive スキップ案内: 解説/課題のいずれでもない“独立要素”とわかる破線バッジ */
.md-typeset > p.passive-skip-note {
  display: inline-block;
  margin: 1em 0;
  padding: 0.45em 1em;
  background: #f8fafc; /* slate-50 */
  border: 1px dashed #94a3b8; /* slate-400（本文と別物感）*/
  border-radius: 0.6em;
  color: #475569; /* slate-600 */
  font-size: 0.7rem;
  font-weight: 700; /* 案内文も太字で目立たせる */
}
.md-typeset > p.passive-skip-note::before {
  content: "⏭ ";
}
[data-md-color-scheme="slate"] .md-typeset > p.passive-skip-note {
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.5);
  color: #cbd5e1; /* slate-300 */
}

/* スキップ / 次へゆく のリンクは、紺背景・白ボールドのボタンで目立たせる */
.md-typeset > p.passive-skip-note a,
.md-typeset > p.passive-next-link a {
  display: inline-block;
  margin-left: 0.35em;
  padding: 0.45em 1.2em;
  background: #1e3a8a; /* navy (blue-900) */
  color: #ffffff !important;
  font-weight: 700;
  border-radius: 0.5em;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(30, 58, 138, 0.3);
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}
.md-typeset > p.passive-skip-note a:hover,
.md-typeset > p.passive-next-link a:hover {
  background: #1d4ed8; /* blue-700 */
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(30, 58, 138, 0.4);
}
/* 「次へゆく」も独立要素として少し間隔を持たせ、案内文も太字に */
.md-typeset > p.passive-next-link {
  margin: 1.2em 0;
  font-weight: 700;
}

.md-typeset h1 {
  font-size: 1.3rem; /* 課題タイトル。既定 ≈1.6rem → 小さめに（本文/H2とのバランス）*/
  color: #1d4ed8; /* blue-700 目立たせる（既定の薄いグレーを上書き）*/
  font-weight: 700;
}
[data-md-color-scheme="slate"] .md-typeset h1 {
  color: #93c5fd; /* blue-300（暗背景で可読）*/
}
.md-typeset h2 {
  font-size: 1rem; /* 既定 ≈1.25rem → 一回り小さく */
}

/* 箇条書きの行間を詰めてコンパクトに（既定: li margin-bottom .5em / list上下 1em）。
   解説の観点リストや「比べるポイント」等が間延びしないようにする。 */
.md-typeset ul,
.md-typeset ol {
  margin-top: 0.4em;
  margin-bottom: 0.4em;
}
.md-typeset ul li,
.md-typeset ol li {
  margin-bottom: 0.15em;
  line-height: 1.45;
}
.md-typeset ul li p,
.md-typeset ol li p {
  margin: 0.15em 0;
}

/* 左ナビ（課題リスト等）のフォントを一回り小さく（全幅共通・0.7→0.62rem）。
   課題名が1行に収まりやすくなり折り返しも減る。ドロワー幅の .md-nav__item{.8rem}
   も同specificityの後勝ちで上書きする。 */
.md-nav {
  font-size: 0.62rem;
}
.md-nav--primary .md-nav__item,
.md-nav--primary .md-nav__title {
  font-size: 0.62rem;
}

/* ============================================================
   生成AIの選択（左ペイン上部トグル）＋ 選択モーダル ＋
   「AIウィンドウ起動」ボタン
   ============================================================ */

/* --- 左ペイン上部の Gemini/ChatGPT トグル --- */
.md-sidebar--primary .ai-selector {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3em;
  margin: 0.5em 0.3em 0.2em;
  font-weight: 400;
}
/* 「使用AI:」ラベルは1行目に左寄せ、AI選択ボタンは次の行に並べる */
.md-sidebar--primary .ai-sel-label {
  flex: 0 0 100%;
  width: 100%;
  margin: 0 0 0.15em;
  font-size: 0.62rem;
  color: #64748b;
  text-align: left;
}
.md-sidebar--primary .ai-sel-btn {
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.3;
  padding: 0.15em 0.6em;
  border: 1px solid #cbd5e1;
  border-radius: 0.8em;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.md-sidebar--primary .ai-sel-btn:hover {
  border-color: #94a3b8;
}
/* 選択中は黒。「🚀 AIウィンドウを起動」ボタンと同じ色に統一する */
.md-sidebar--primary .ai-sel-btn.is-active {
  background: #111827; /* gray-900 */
  border-color: #111827;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
[data-md-color-scheme="slate"] .md-sidebar--primary .ai-sel-btn {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.5);
  color: #cbd5e1;
}
[data-md-color-scheme="slate"] .md-sidebar--primary .ai-sel-btn.is-active {
  /* 暗背景では純黒が沈むため、起動ボタンと同じ濃グレー＋淡い枠にする */
  background: #475569; /* slate-600 */
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

/* --- AI選択モーダル --- */
.ai-modal-overlay {
  position: fixed;
  inset: 0;
  /* 背後のページ（設定手順の説明など）を読みながら操作できるよう薄めにする */
  background: rgba(15, 23, 42, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}
.ai-modal {
  background: #ffffff;
  border-radius: 0.9rem;
  padding: 1.4em 1.6em;
  max-width: 92vw;
  width: 24rem;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}
.ai-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 1em;
}
.ai-modal-btns {
  display: flex;
  flex-direction: column; /* 3択になったため縦積みで見やすく */
  gap: 0.6em;
  align-items: stretch;
}
.ai-modal-btn {
  width: 100%;
  padding: 0.7em 0.8em;
  border: none;
  border-radius: 0.6em;
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.1s, filter 0.15s;
}
.ai-modal-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}
.ai-modal-gemini {
  background: #1a73e8;
}
.ai-modal-chatgpt {
  background: #10a37f;
}
.ai-modal-copilot {
  background: linear-gradient(135deg, #0f6cbd, #7b57d6); /* Copilot: 青→紫 */
}
.ai-modal-note {
  margin-top: 1em;
  font-size: 0.78rem;
  color: #64748b;
}
[data-md-color-scheme="slate"] .ai-modal {
  background: #1e293b;
}
[data-md-color-scheme="slate"] .ai-modal-title {
  color: #f1f5f9;
}
[data-md-color-scheme="slate"] .ai-modal-note {
  color: #94a3b8;
}

/* --- 🏋課題見出しの「AIウィンドウ起動」ボタン --- */
.md-typeset h2 > .ai-launch-btn {
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.7em;
  padding: 0.28em 0.9em;
  border: none;
  border-radius: 0.5em;
  /* 黒。チェックポイントの✔ボタン（青・緑）と色がぶつからないようにする */
  background: #111827; /* gray-900 */
  color: #ffffff;
  font-size: 0.62em;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: background 0.15s, transform 0.1s;
}
.md-typeset h2 > .ai-launch-btn:hover {
  background: #000000;
  transform: translateY(-1px);
}
[data-md-color-scheme="slate"] .md-typeset h2 > .ai-launch-btn {
  /* 暗背景では純黒が沈むため、濃いグレー＋淡い枠で浮かせる */
  background: #475569; /* slate-600 */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25), 0 2px 6px rgba(0, 0, 0, 0.4);
}
[data-md-color-scheme="slate"] .md-typeset h2 > .ai-launch-btn:hover {
  background: #334155; /* slate-700 */
}

/* ============================================================
   左サイドバーの独立スクロール（≥60em）
   ------------------------------------------------------------
   Material 既定では広い画面のサイドバーは height:0/overflow:visible の
   sticky で、独自スクロール領域を持たず「ページごと」スクロールする。
   サイドバーに固定高のスクロール領域を与え、overscroll-behavior:contain で
   端に達してもページへホイールを伝播させない。これにより
   ・左パネル上のスクロール → 左パネルだけがスクロール
   ・右の課題領域上のスクロール → ページ（右領域）だけがスクロール（サイドバーは sticky で静止）
   ============================================================ */
@media screen and (min-width: 60em) {
  .md-sidebar.md-sidebar--primary {
    position: sticky;
    top: 2.4rem;
    height: calc(100vh - 2.4rem);
    padding-top: 0;
    padding-bottom: 0;
    align-self: flex-start;
  }
  .md-sidebar--primary .md-sidebar__scrollwrap {
    position: static;
    height: 100%;
    margin: 0;
    padding: 1.2rem 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
  }
}

/* ============================================================
   設定パネル / モニタリングモード / フィードバック登録
   ------------------------------------------------------------
   モーダルの外枠は既存の .ai-modal-overlay / .ai-modal を流用する。
   ============================================================ */
/* 元の配色トグルは「設定」ボタンの中に移したので隠す */
body.has-settings-btn .md-header__inner form[data-md-component="palette"] {
  display: none;
}
.md-header__button.settings-btn {
  font-size: 1rem;
  line-height: 1;
  background: none;
  border: none;
  color: currentColor;
  cursor: pointer;
}
.fb-modal,
.reg-modal,
.set-modal {
  max-width: 26rem;
  text-align: left;
}
.fb-title {
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.5em;
}
.fb-lesson {
  padding: 0.4em 0.6em;
  margin-bottom: 0.8em;
  background: #f1f5f9;
  border-left: 3px solid #64748b;
  font-size: 0.72rem;
  font-weight: 700;
}
.fb-label,
.set-sec {
  margin: 0.7em 0 0.35em;
  font-size: 0.66rem;
  font-weight: 700;
  color: #475569;
}
.set-sec {
  padding-top: 0.6em;
  border-top: 1px solid #e2e8f0;
}
.fb-ratings,
.set-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
}
.fb-rating,
.set-btn {
  padding: 0.35em 0.8em;
  border: 1px solid #cbd5e1;
  border-radius: 0;
  background: #fff;
  color: #334155;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}
.fb-rating.is-on,
.set-btn.is-on {
  background: #111827;
  border-color: #111827;
  color: #fff;
}
.set-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.fb-comment,
.reg-nick,
.reg-email {
  width: 100%;
  padding: 0.45em 0.6em;
  border: 1px solid #cbd5e1;
  border-radius: 0;
  font-size: 0.7rem;
  font-family: inherit;
}
.reg-note,
.set-desc {
  font-size: 0.64rem;
  line-height: 1.6;
  color: #64748b;
}
.reg-warn {
  margin-top: 0.7em;
  padding: 0.5em 0.6em;
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  font-size: 0.62rem;
  line-height: 1.65;
  color: #78350f;
}
.reg-err {
  min-height: 1em;
  margin-top: 0.4em;
  font-size: 0.62rem;
  font-weight: 700;
  color: #dc2626;
}
.fb-btns {
  display: flex;
  justify-content: flex-end;
  gap: 0.5em;
  margin-top: 1em;
}
.fb-skip {
  padding: 0.4em 0.9em;
  border: 1px solid #cbd5e1;
  border-radius: 0;
  background: #fff;
  color: #475569;
  font-size: 0.68rem;
  cursor: pointer;
}
.fb-send {
  padding: 0.4em 1.1em;
  border: none;
  border-radius: 0;
  background: #111827;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}
.set-user {
  margin-top: 0.6em;
}
.set-user .set-btn {
  margin-top: 0.5em;
}
/* ダークモード */
[data-md-color-scheme="slate"] .fb-lesson {
  background: rgba(255, 255, 255, 0.08);
}
[data-md-color-scheme="slate"] .fb-label,
[data-md-color-scheme="slate"] .set-sec {
  color: #cbd5e1;
}
[data-md-color-scheme="slate"] .fb-rating,
[data-md-color-scheme="slate"] .set-btn,
[data-md-color-scheme="slate"] .fb-skip,
[data-md-color-scheme="slate"] .fb-comment,
[data-md-color-scheme="slate"] .reg-nick,
[data-md-color-scheme="slate"] .reg-email {
  background: transparent;
  border-color: #475569;
  color: #e2e8f0;
}
[data-md-color-scheme="slate"] .fb-rating.is-on,
[data-md-color-scheme="slate"] .set-btn.is-on,
[data-md-color-scheme="slate"] .fb-send {
  background: #475569;
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}
[data-md-color-scheme="slate"] .reg-warn {
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
}

/* ============================================================
   左ペイン上部（使用AI／実施状況／実習コンテンツ:）の固定表示
   ------------------------------------------------------------
   ≥60em（サイドバーがカラム表示になる幅）でのみ、上部ブロックを
   スクロール時に画面上部へ固定する。<60em のオフキャンバス
   ドロワーには一切適用しない（Material 標準の挙動＝ドリルダウン
   ナビ・青ヘッダをそのまま使う）。
   ※ ファイル末尾に置くことで、60〜76.23em 帯の [for=__drawer] 付き
      同特異度ルール(position:static)にソース順で勝つ。
   ============================================================ */
@media screen and (min-width: 60em) {
  .md-sidebar--primary .md-nav--primary > .md-nav__title,
  .md-sidebar--primary .md-nav--primary > .md-nav__title[for="__drawer"] {
    position: sticky;
    top: 0;
    z-index: 5; /* 課題リストのマーク(.lesson-marks=2)より前面へ */
    background: var(--md-default-bg-color);
    /* 上余白はここ(padding-top)で取り、背景で上端まで覆う（透け防止） */
    padding-top: 0.84rem;
  }
  /* scrollwrap の上 padding は 0 に（上余白は title 側へ移した）。
     ここに余白があると固定領域の上へ隙間ができ、後ろが透ける。 */
  .md-sidebar--primary .md-sidebar__scrollwrap {
    padding-top: 0;
  }
}

/* 本文（右領域）上部の余白を30%詰める（Material既定 12px → 8.4px）。
   ドロワーのナビ挙動には影響しない。 */
.md-content__inner {
  padding-top: 8.4px;
}

/* ============================================================
   文字サイズ調整（設定パネルで切替）
   ------------------------------------------------------------
   html の font-size をスケールし、rem ベースの Material 全体を比例拡大する。
   既定(標準)は Material の 125%(20px)。クラスは <html> に付与する。
   ============================================================ */
html.fs-md {
  font-size: 137.5%; /* 少し大きめ（本文 約15.4px） */
}
html.fs-lg {
  font-size: 150%; /* 大きめ（本文 約16.8px） */
}

/* イントロダクション「進めるときのポイント」：項目ごとに図を含み長いため、
   2項目め以降の前に余白を入れて区切りを分かりやすくする。 */
.md-typeset .points-list > ul > li + li {
  margin-top: 1.6em;
}

/* 設定パネルだけは画面の「上寄せ中央」に出す。
   イントロダクションの「お願い事項」など、背後のページの説明を読みながら
   設定を操作できるようにするため（他のモーダルは中央のまま）。 */
.ai-modal-overlay.set-overlay {
  align-items: flex-start;
  padding-top: 3.2rem;
}
.ai-modal-overlay.set-overlay .set-modal {
  max-height: calc(100vh - 5rem);
  overflow-y: auto;
}

/* 設定パネルの上にユーザ登録が重なると、オーバーレイが2枚になって
   背後が二重に暗くなる。上に乗る側はごく薄くして暗さの重なりを防ぐ。 */
.ai-modal-overlay.set-overlay ~ .ai-modal-overlay.reg-overlay {
  background: rgba(15, 23, 42, 0.08);
}

/* コンパクトな表（お願い事項の「登録・記録される情報」など）。
   行の上下を詰め、少し右にインデントして本文と区別する。 */
.md-typeset .compact-table {
  margin-left: 1.6em;
}
.md-typeset .compact-table table:not([class]) {
  margin: 0.4em 0;
  font-size: 0.66rem;
}
.md-typeset .compact-table table:not([class]) th,
.md-typeset .compact-table table:not([class]) td {
  padding: 0.25em 0.7em;
  line-height: 1.5;
}
