/* =========================================================
   デジタルヒューマン埋め込みガイド — デザイントークン
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Material のテーマ変数を上書き */
  --md-primary-fg-color:         #24406B;
  --md-primary-fg-color--light:  #3E5C8A;
  --md-primary-fg-color--dark:   #162A47;
  --md-accent-fg-color:          #B23A2E;
  --md-default-bg-color:         #F5F6FA;
  --md-default-fg-color:         #1B2333;
  --md-default-fg-color--light:  #5B6478;
  --md-default-fg-color--lighter:#767F92;
  --md-typeset-a-color:          #24406B;
  --md-code-bg-color:            #101826;
  --md-code-fg-color:            #CFEAE0;

  /* 独自トークン（原デザイン準拠） */
  --ink-soft:     #5B6478;
  --ink-faint:    #767F92;   /* 元の #8991A3 よりコントラストを強めた */
  --border:       #E2E5EC;
  --primary:      #24406B;
  --primary-deep: #162A47;
  --primary-soft: #EEF2F8;
  --accent:       #B23A2E;
  --accent-soft:  #FBEDEB;
  --success:      #1E8F7A;
  --success-soft: #E7F5F1;
  --radius:       10px;
}

/* ---------- タイポグラフィ ---------- */
body, .md-typeset {
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.85;
}
code, pre, kbd, .md-typeset code {
  font-family: "JetBrains Mono", monospace !important;
}
.md-typeset h1 { font-weight: 900; letter-spacing: 0.01em; }
.md-typeset h2 { font-weight: 700; }
.md-typeset h2 code.section-num,
.section-num {
  font-family: "JetBrains Mono", monospace;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.8em;
  margin-right: 8px;
}

/* ---------- admonition（callout） ---------- */
.md-typeset .admonition,
.md-typeset details {
  border-radius: 0 8px 8px 0;
  border-left-width: 3px;
}
.md-typeset .admonition.note,
.md-typeset .admonition.info {
  border-left-color: var(--primary);
  background-color: var(--primary-soft);
}
.md-typeset .admonition.note > .admonition-title,
.md-typeset .admonition.info > .admonition-title {
  background-color: var(--primary-soft);
  color: var(--primary);
}
.md-typeset .admonition.warning {
  border-left-color: var(--accent);
  background-color: var(--accent-soft);
}
.md-typeset .admonition.warning > .admonition-title {
  background-color: var(--accent-soft);
  color: var(--accent);
}

/* ---------- テーブル ---------- */
.md-typeset table:not([class]) th {
  background-color: var(--primary-soft);
  color: var(--primary);
  font-size: 0.8em;
  letter-spacing: 0.02em;
}
.md-typeset table:not([class]) {
  border-radius: var(--radius);
  overflow-x: auto;   /* モバイルで表がクリップされず横スクロールできる */
  display: block;
}
@media (min-width: 960px) {
  .md-typeset table:not([class]) { display: table; width: 100%; }
}
.req-yes { color: var(--accent); font-weight: 700; font-size: 0.85em; white-space: nowrap; }
.req-no  { color: var(--ink-faint); font-size: 0.85em; white-space: nowrap; }

/* ---------- タブ（推奨方式と使用シーン） ---------- */
.md-typeset .tabbed-set > label {
  font-weight: 600;
  border-radius: 999px;
}
.md-typeset .tabbed-set > input:checked + label {
  background-color: var(--primary);
  color: #fff;
}

/* ---------- コードブロック ---------- */
.md-typeset .highlight {
  border-radius: var(--radius);
}

/* =========================================================
   カスタムコンポーネント（Material 標準にないもの）
   ========================================================= */

/* 印章バッジ（ヘッダー右上に置く想定） */
.stamp {
  width: 56px; height: 56px; border-radius: 50%;
  border: 2.5px solid var(--accent);
  color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  text-align: center; font-weight: 700; font-size: 11px; line-height: 1.25;
  background: rgba(255,255,255,0.96);
  transform: rotate(-8deg);
  letter-spacing: 0.04em;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}

/* meta chip（バージョン / 環境 / 更新日） */
.meta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 28px; }
.meta-chip {
  font-size: 12px; color: var(--ink-soft); background: var(--md-default-bg-color);
  border: 1px solid var(--border); border-radius: 7px; padding: 6px 11px;
  display: inline-flex; gap: 6px; align-items: center;
}
.meta-chip b { color: var(--md-default-fg-color); font-weight: 600; }

/* ステッパー（導入手順） */
.steps { display: flex; flex-direction: column; }
.step { display: flex; gap: 18px; padding: 20px 0; border-bottom: 1px dashed var(--border); }
.step:last-child { border-bottom: none; }
.step-num {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); color: #fff; display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 14px;
}
.step-body { flex: 1; min-width: 0; }
.step-body > :first-child { margin-top: 0; }

/* =========================================================
   カスタムシェルレイアウト（overrides/main.html 用）
   ========================================================= */

/* Material デフォルトコンポーネントを隠す */
.md-header, .md-tabs, .md-sidebar, .md-footer,
.md-content__button, .md-nav--lifted, .md-nav--secondary,
.md-top, .md-search__overlay { display: none !important; }

.md-main__inner { margin: 0 !important; max-width: none !important; }
.md-content { max-width: none; }
.md-content__inner { margin: 0; padding: 0; }
.md-content__inner::before, .md-content__inner::after { display: none; }

.guide-shell { min-height: 100vh; background: var(--bg); }

/* トップバー */
.guide-topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 65px; padding: 14px 28px;
  background: var(--primary-deep); color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.guide-topbar__left, .guide-topbar__right { display: flex; align-items: center; gap: 14px; }
.guide-topbar__left, .guide-topbar__titles { min-width: 0; }
.guide-topbar__title {
  color: #fff; font-size: 15px; font-weight: 700; letter-spacing: 0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.guide-topbar__subtitle {
  margin-top: 2px; color: #B9C4D9; font-size: 11.5px; letter-spacing: 0.02em;
}
.guide-env-tag {
  font-family: "JetBrains Mono", "Noto Sans JP", monospace !important;
  border: 1px solid rgba(255,255,255,0.28); border-radius: 999px;
  padding: 5px 12px; color: #DCE4F2;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.guide-menu-toggle {
  display: none; width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.35);
  background: transparent; color: #fff; cursor: pointer; padding: 0; flex-shrink: 0;
}
.guide-menu-toggle span {
  display: block; width: 16px; height: 2px; margin: 3px auto;
  background: currentColor; border-radius: 2px;
}

/* レイアウト */
.guide-layout { display: flex; align-items: flex-start; max-width: 1240px; margin: 0 auto; }

/* サイドバー */
.guide-sidebar {
  width: 272px; flex-shrink: 0;
  position: sticky; top: 65px; height: calc(100vh - 65px);
  overflow-y: auto; padding: 28px 14px 40px 28px;
  border-right: 1px solid var(--border); background: var(--bg);
}
.guide-sidebar__label {
  margin: 0 0 12px 10px;
  color: var(--ink-faint); font-size: 14px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.guide-sidebar__nav a {
  display: flex; align-items: baseline; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  color: var(--ink-soft); text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.guide-sidebar__nav a:hover,
.guide-sidebar__nav a.is-active {
  background: var(--primary-soft); color: var(--primary);
}
.guide-sidebar__nav .num {
  width: 18px; flex-shrink: 0; color: var(--ink-faint); font-size: 12px;
  font-family: "JetBrains Mono", "Noto Sans JP", monospace !important;
}
.guide-sidebar__nav a.is-active .num { color: var(--primary); }

/* メインコンテンツ */
.guide-main { flex: 1; min-width: 0; }
.guide-article { padding: 44px 56px 120px; }
.guide-article > h1:first-of-type {
  margin: 0 0 10px; color: var(--ink);
  font-size: 28px; font-weight: 900; letter-spacing: 0.01em;
}

.md-typeset h2[id] { scroll-margin-top: 86px; }

/* FAQ */
.faq-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 0 26px; }
.faq-item { padding: 16px 0; border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-line { display: flex; gap: 10px; }
.faq-line + .faq-line { margin-top: 8px; }
.faq-mark { font-weight: 700; font-family: "JetBrains Mono", "Noto Sans JP", monospace !important; }
.faq-line--q .faq-mark { color: var(--primary); }
.faq-line--q { color: var(--ink); font-size: 14px; font-weight: 700; }
.faq-line--a .faq-mark { color: var(--accent); }
.faq-line--a { color: var(--ink-soft); font-size: 13.5px; }

/* フッター */
.guide-footer {
  max-width: 1240px; margin: 0 auto;
  padding: 24px 56px; border-top: 1px solid var(--border);
  color: var(--ink-faint);
  display: flex; justify-content: space-between; flex-wrap: wrap;
  gap: 8px; font-size: 12px;
}

/* オーバーレイ（モバイルサイドバー用） */
.guide-overlay {
  position: fixed; inset: 65px 0 0 0; z-index: 45;
  background: rgba(11,19,34,0.32);
}
.guide-overlay[hidden] { display: none; }

/* フォーカス可視 */
.guide-sidebar__nav a:focus-visible,
.guide-menu-toggle:focus-visible,
.check-item input:focus-visible {
  outline: none; box-shadow: 0 0 0 3px rgba(36, 64, 107, 0.2);
}

/* レスポンシブ */
@media (max-width: 900px) {
  .guide-menu-toggle { display: inline-block; }
  .guide-sidebar {
    position: fixed; left: 0; top: 65px; z-index: 50;
    width: 78vw; max-width: 300px; height: calc(100vh - 65px);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 8px 0 24px rgba(0,0,0,0.12);
  }
  .guide-sidebar.is-open { transform: translateX(0); }
  .guide-article { padding: 32px 20px 100px; }
  .guide-article > h1:first-of-type { font-size: 22px; }
  .guide-footer { padding: 20px; }
}
