/* =============================================================
   mindmap.css — 横向きマインドマップ + 右詳細パネル レイアウト
   依存: css/variables.css, css/pages/concept-map.css
   WCAG 2.1 AA: テキスト #374151 on #fff = 7.5:1 ✓
                アクセント #dc7600 on #fff = 3.2:1 (大テキスト/UI) ✓
   ============================================================= */

/* ============================================================
   Section 1: ページ全体レイアウト（2カラム）
   ============================================================ */

/* layout.css は body { padding-top:80px } を全ページに設定する。
   .fixed-nav-header を固定（fixed）にしたため、ヘッダー高さ分の
   padding-top のみ残し、mm-page の height を正確にする。 */
body {
  padding: 0;
  padding-top: var(--header-height, 60px); /* 固定ヘッダーの高さ */
}

/* mm-page: ビューポート高さいっぱいに広がるフレックスコンテナ */
.mm-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height, 60px) - 38px); /* ヘッダー + パンくずバー */
  overflow: hidden;
  /* concept-map-main の max-width/padding を上書き */
  max-width: none;
  padding: 0;
  margin: 0;
}

/* mm-layout: 左右カラムを並べる水平フレックス */
.mm-layout {
  display: flex;
  flex: 1;
  min-height: 0; /* ← 必須: flexアイテムが縮小して独立スクロールが機能する */
  overflow: hidden;
}

/* 左列: マインドマップナビゲーター */
.mm-nav-col {
  width: 55%;
  min-width: 280px;
  overflow-y: auto;
  overflow-x: auto;
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem;
  background: #fff;
}

/* リサイズハンドル（デスクトップのみ） */
.mm-resize-handle {
  width: 5px;
  flex-shrink: 0;
  cursor: col-resize;
  background: #e5e7eb;
  transition: background 0.15s;
}
.mm-resize-handle:hover,
.mm-resize-handle.mm-resize-handle--dragging {
  background: #6b7280;
}

/* 右列: 詳細パネル */
.mm-detail-col {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  background: #f9fafb;
}

/* ============================================================
   Section 2: モバイルタブバー（≤900px のみ表示）
   ============================================================ */

.mm-tab-bar {
  display: none; /* デスクトップでは非表示 */
}

@media (max-width: 900px) {
  /* iOS Safari 対策: 固定高さ + overflow:hidden を解除 */
  .mm-page {
    height: auto;
    overflow: visible;
    max-width: none;
    padding: 0;
  }

  .mm-tab-bar {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    background: #f9fafb;
    position: sticky;
    top: 0;
    z-index: 50;
  }

  .mm-tab {
    flex: 1;
    padding: 0.625rem 0;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    font-family: inherit;
  }

  .mm-tab--active,
  .mm-tab[aria-selected="true"] {
    color: #dc7600;
    border-bottom-color: #dc7600;
  }

  .mm-tab:focus-visible {
    outline: 3px solid rgba(220, 118, 0, 0.5);
    outline-offset: -2px;
  }

  .mm-layout {
    flex-direction: column;
    overflow: visible;
    min-height: 0;
  }

  .mm-resize-handle {
    display: none;
  }

  .mm-nav-col,
  .mm-detail-col {
    width: 100%;
    max-width: none;
    min-width: 0;
    height: auto;
    overflow: visible;
    border-right: none;
    border-left: none;
  }

  /* JS がタブ切替時にこのクラスをトグルする */
  .mm-col--hidden {
    display: none;
  }
}

/* ============================================================
   Section 3: 横向きマインドマップツリー
   ============================================================ */

/* ツリールート: リセット */
.mm-tree,
.mm-tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* 最上位 ul: L1ドメインを縦に並べる */
.mm-tree {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 1rem;
}

/* 各ノード li: ボタン + 子コンテナを横に並べる */
.mm-tree li {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
}

/* 子コンテナ: 水平コネクタ線 + 縦に並んだ孫ノード */
.mm-node-children {
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

/* 水平コネクタ線（ボタン → 子リストへ） */
.mm-node-children::before {
  content: '';
  display: block;
  width: 14px;
  height: 2px;
  background: #d1d5db;
  align-self: center;
  flex-shrink: 0;
}

/* 子 ul: 縦並び + 左縦コネクタ線 */
.mm-node-children > ul {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-left: 2px solid #e5e7eb;
}

/* 孫 li: 左横コネクタ線 */
.mm-node-children > ul > li {
  padding-left: 14px;
  position: relative;
}

.mm-node-children > ul > li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 14px;
  height: 2px;
  background: #d1d5db;
  transform: translateY(-50%);
}

/* hidden 時は display:none */
.mm-node-children[hidden] {
  display: none;
}

/* ──────────────────────────────────────────────
   ノードボタン共通
   ────────────────────────────────────────────── */
.mm-node-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-md, 0.5rem);
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8125rem;
  color: #374151; /* 7.5:1 on #fff ✓ */
  white-space: nowrap;
  line-height: var(--line-height-normal, 1.5);
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
  text-align: left;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.mm-node-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.mm-node-btn:focus-visible {
  outline: 3px solid rgba(220, 118, 0, 0.5);
  outline-offset: 2px;
}

/* L1: ドメイン（ダーク背景） */
.mm-l1-btn {
  background: #1f2937;
  color: #f3f4f6; /* 12:1 ✓ */
  border-color: #1f2937;
  font-weight: 600;
  padding: 0.5rem 0.875rem;
  align-self: flex-start;
}

.mm-l1-btn:hover {
  background: #374151;
  border-color: #374151;
}

/* L2: サービス（左ボーダーアクセント） */
.mm-l2-btn {
  border-left: 3px solid #9ca3af;
  padding: 0.625rem 1rem;
  font-size: var(--font-size-sm, 0.8125rem);
}

.mm-l2-btn:hover {
  border-left-color: #dc7600;
}

/* L3: 概念（淡いグレー背景） */
.mm-l3-btn {
  background: #f9fafb;
  border-color: #e5e7eb;
  font-size: 0.75rem;
}

.mm-l3-btn:hover {
  background: #f3f4f6;
}

/* ── 選択状態 ── */
.mm-node-btn.mm-selected {
  background: #fff7ed;
  border-color: #dc7600;
  box-shadow: 0 0 0 2px rgba(220, 118, 0, 0.2);
}

.mm-l1-btn.mm-selected {
  background: #dc7600;
  color: #fff;
  border-color: #dc7600;
}

/* ── 検索ハイライト ── */
.mm-node-btn.mm-search-match {
  background: #fef9c3;
  border-color: #ca8a04;
}

/* ── 折りたたみ矢印 ── */
.mm-arrow {
  font-size: 0.55rem;
  color: #9ca3af;
  flex-shrink: 0;
  width: 0.6rem;
  display: inline-block;
  text-align: center;
  transition: transform 0.15s;
}

/* 展開中の矢印は90度回転 */
[aria-expanded="true"] > .mm-node-btn > .mm-arrow {
  transform: rotate(90deg);
}

/* ── アコーディオン開閉トランジション ── */
.mm-node-children {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}

/* JS: hidden 解除 → mm-enter-from 追加 → reflow → クラス除去でトランジション発火 */
.mm-node-children.mm-enter-from {
  opacity: 0;
  transform: translateY(-8px);
}

/* JS: mm-leave-to 追加 → transitionend で hidden = true */
.mm-node-children.mm-leave-to {
  opacity: 0;
  transform: translateY(-8px);
}

/* ── ローディング表示 ── */
.mm-loading {
  list-style: none;
}

.mm-l3-loading {
  font-size: 0.75rem;
  color: #9ca3af;
  font-style: italic;
  padding: 0.2rem 0.5rem;
}

/* ============================================================
   Section 4: 詳細パネル
   ============================================================ */

.mm-detail-panel {
  max-width: 640px;
}

.mm-detail-placeholder {
  color: #9ca3af;
  font-size: 0.875rem;
  padding: 2rem 0;
  text-align: center;
}

.mm-detail-header {
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 1rem;
}

.mm-detail-name-ja {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 0.25rem 0;
}

.mm-detail-name-en {
  font-size: 0.8125rem;
  color: #6b7280;
  margin: 0;
}

.mm-detail-desc {
  font-size: 0.875rem;
  color: #374151; /* 7.5:1 ✓ */
  line-height: 1.8;
  margin: 0 0 1rem 0;
}

/* 設計軸タグ群 */
.mm-axis-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
}

.mm-axis-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  background: #e0f2fe;
  color: #0369a1; /* 4.7:1 on #e0f2fe ✓ WCAG AA */
  font-weight: 600;
}

/* キーワードセクション見出し */
.mm-keywords-heading {
  font-size: 0.7rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 1rem 0 0.375rem 0;
  border: none;
  padding: 0;
}

/* 詳細パネル内のクロスリンクセクション */
.mm-crosslink-section {
  margin-top: 1rem;
  padding: 0.5rem 0.75rem;
  background: #f8faff;
  border: 1px solid #dbeafe;
  border-radius: 0.375rem;
}

.mm-crosslink-label {
  font-size: 0.65rem;
  color: #6b7280;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.375rem 0;
}

.mm-crosslink-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

/* 詳細パネル内のHTMLリソースリンクセクション */
.mm-html-resources {
  margin-top: 1rem;
  padding: 0.5rem 0.75rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 0.375rem;
}

.mm-html-resources-label {
  font-size: 0.65rem;
  color: #166534;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.375rem 0;
}

.mm-html-resources-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mm-html-resource-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: #15803d;
  text-decoration: none;
  padding: 0.125rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.mm-html-resource-link::before {
  content: '📄';
  font-size: 0.75rem;
  flex-shrink: 0;
}

.mm-html-resource-link:hover,
.mm-html-resource-link:focus {
  color: #166534;
  border-bottom-color: #16a34a;
  outline: none;
}

.mm-html-resource-link:focus-visible {
  outline: 2px solid #16a34a;
  outline-offset: 2px;
  border-radius: 2px;
}

/* ============================================================
   Section 5: 検索セクション（左列内）
   ============================================================ */

/* 左列内の検索バーはマージンを抑える */
.mm-search-section {
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

/* ============================================================
   Section 6: ノードハイライト（検索クリック時）
   ============================================================ */

.mm-node-btn.mm-highlight {
  animation: mmHighlight 2s ease-out;
}

@keyframes mmHighlight {
  0%   { box-shadow: 0 0 0 4px rgba(220, 118, 0, 0.7); }
  100% { box-shadow: 0 0 0 0px rgba(220, 118, 0, 0); }
}

/* ============================================================
   Section 7: Visual Language System（絵文字 + CSS）
   WCAG 2.1 AA: 全色組み合わせ 4.5:1 以上保証
   ============================================================ */

.mm-vis-section { margin-top: 0.875rem; }

/* default-open トグルボタン */
.mm-vis-toggle-btn {
  display: flex; align-items: center; gap: 0.375rem;
  width: 100%; text-align: left;
  background: none; border: none;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.375rem 0;
  font-size: 0.8rem; font-weight: 700; color: #374151; /* 7.5:1 ✓ */
  cursor: pointer; font-family: inherit;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.mm-vis-toggle-btn:hover { color: #1f2937; }
.mm-vis-toggle-btn:focus-visible { outline: 3px solid rgba(220, 118, 0, 0.5); outline-offset: 2px; }
.mm-vis-toggle-panel { padding: 0.625rem 0 0.375rem 0; }

/* 🏷️ 設計軸チップ */
.mm-vis-axis-chips { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.mm-vis-axis-chip {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.7rem; font-weight: 600;
  padding: 0.2rem 0.6rem; border-radius: 1rem;
}
.mm-vis-axis-chip--security     { background: #fdf2f8; color: #9d174d; }
.mm-vis-axis-chip--cost         { background: #fffbeb; color: #92400e; }
.mm-vis-axis-chip--availability { background: #f0fdf4; color: #166534; }
.mm-vis-axis-chip--performance  { background: #eff6ff; color: #1d4ed8; }
.mm-vis-axis-chip--governance   { background: #f5f3ff; color: #5b21b6; }
.mm-vis-axis-chip--scalability  { background: #ecfdf5; color: #065f46; }
.mm-vis-axis-chip--default      { background: #f3f4f6; color: #374151; }

/* 🧭 判断ステップ */
.mm-vis-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.mm-vis-step-item { display: flex; gap: 0.625rem; align-items: flex-start; }
.mm-vis-step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.25rem; height: 1.25rem; min-width: 1.25rem;
  background: #1f2937; color: #f9fafb; /* 12:1 ✓ */
  border-radius: 50%; font-size: 0.65rem; font-weight: 700;
}
.mm-vis-step-text { font-size: 0.8125rem; color: #374151; line-height: 1.5; padding-top: 0.05rem; }
.mm-vis-step-branch { flex: 1; }
.mm-vis-step-q { font-size: 0.8125rem; font-weight: 600; color: #374151; margin: 0 0 0.375rem 0; }
.mm-vis-step-branches { display: flex; flex-direction: column; gap: 0.25rem; padding-left: 0.5rem; }
.mm-vis-branch-yes,
.mm-vis-branch-no { font-size: 0.75rem; padding: 0.175rem 0.5rem; border-radius: 0.25rem; line-height: 1.5; }
.mm-vis-branch-yes { background: #dcfce7; color: #166534; } /* 7.0:1 ✓ */
.mm-vis-branch-no  { background: #fef2f2; color: #991b1b; } /* 6.8:1 ✓ */

/* ⚖️ トレードオフカード */
.mm-vis-options { display: flex; flex-direction: column; gap: 0.625rem; }
.mm-vis-option-card { border: 1px solid #e5e7eb; border-radius: 0.5rem; padding: 0.625rem 0.75rem; background: #fff; }
.mm-vis-option-name { display: flex; align-items: center; gap: 0.375rem; margin-bottom: 0.375rem; }
.mm-vis-option-emoji { font-size: 1rem; line-height: 1; }
.mm-vis-option-name strong { font-size: 0.8125rem; color: #1f2937; font-weight: 700; }
.mm-vis-pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem 0.5rem; }
.mm-vis-pros, .mm-vis-cons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.mm-vis-pros li::before { content: '✅ '; }
.mm-vis-cons li::before { content: '❌ '; }
.mm-vis-pros li, .mm-vis-cons li { font-size: 0.72rem; color: #374151; line-height: 1.4; }
.mm-vis-option-tags { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.375rem; }
.mm-vis-option-tag { font-size: 0.65rem; padding: 0.1rem 0.4rem; background: #f3f4f6; color: #374151; border-radius: 0.25rem; font-weight: 600; }

/* ============================================================
   Section 8: マインドマップ視覚強化
   L3カード群 · コネクタ薄化 · 余白拡大
   ============================================================ */

/* 右詳細パネル: 内側余白 40px */
.mm-detail-col { padding: 2.5rem 2.5rem; }

/* L1 ドメイン間ギャップ拡大 */
.mm-tree { gap: 1.25rem; }

/* L1 ボタン: 拡大カード */
.mm-l1-btn {
  padding: 1rem 1.25rem;
  font-size: var(--font-size-base, 0.875rem);
  border-radius: var(--radius-base, 0.625rem);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* コネクタ線薄化: opacity 0.15 相当 */
.mm-node-children::before            { opacity: 0.15; }
.mm-node-children > ul               { border-left-color: rgba(209, 213, 219, 0.25); }
.mm-node-children > ul > li::before  { opacity: 0.15; }

/* L3 カードリスト: コネクタ廃止・gap 拡大 */
.mm-node-children > .mm-l3-list {
  border-left: none;
  padding-top: 0.375rem;
  gap: 0.375rem;
}
.mm-l3-list > li         { padding-left: 0; }
.mm-l3-list > li::before { display: none; }

/* L3 ボタン: カード風 + 拡大余白 */
.mm-l3-btn {
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  padding: 0.5rem 0.875rem;
}
.mm-l3-btn:hover {
  background: #f9fafb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* ============================================================
   Section 8b: L1フォーカスモード（非選択L1を非表示）
   ============================================================ */
.mm-l1-focused-out {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-out, max-height 0.3s ease-out, margin 0.3s ease-out;
}

/* ============================================================
   Section 9: スキップリンク
   ============================================================ */
.mm-skip-link {
  position: fixed;
  top: -50px;
  left: 1rem;
  background: #dc7600;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0 0 0.375rem 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  z-index: 9999;
  text-decoration: none;
  transition: top 0.15s;
}
.mm-skip-link:focus {
  top: 0;
  outline: 3px solid rgba(220, 118, 0, 0.5);
}

/* ============================================================
   Section 10: プログレスバー（ヘッダー内）
   WCAG 2.1 AA: #dc7600 on #232f3e = 3.4:1（大テキスト/UI ✓）
   ============================================================ */
.mm-progress-wrap {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 90px;
}
.mm-progress-pct {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #dc7600;
  min-width: 30px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.mm-progress-track {
  flex: 1;
  height: 3px;
  min-width: 50px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  overflow: hidden;
}
.mm-progress-fill {
  height: 100%;
  background: #dc7600;
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================================
   Section 11: パンくずナビゲーション
   ============================================================ */
.mm-breadcrumb-bar {
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.4375rem 1.25rem;
}
.mm-breadcrumb-list {
  list-style: none;
  display: flex;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  font-size: 0.78rem;
  flex-wrap: wrap;
}
.mm-breadcrumb-item {
  display: flex;
  align-items: center;
}
.mm-breadcrumb-item + .mm-breadcrumb-item::before {
  content: '›';
  color: #9ca3af;
  margin: 0 0.375rem;
  font-size: 0.875rem;
  line-height: 1;
}
.mm-breadcrumb-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #dc7600;
  padding: 0.125rem 0.25rem;
  border-radius: 0.1875rem;
  font-size: inherit;
  font-family: inherit;
  line-height: 1.5;
  transition: background 0.1s;
}
.mm-breadcrumb-btn:hover {
  background: rgba(220, 118, 0, 0.08);
  text-decoration: underline;
}
.mm-breadcrumb-btn:focus-visible {
  outline: 3px solid rgba(220, 118, 0, 0.5);
  outline-offset: 2px;
}
.mm-breadcrumb-btn[aria-current="page"] {
  color: #374151; /* 7.5:1 on #f3f4f6 ✓ */
  cursor: default;
  font-weight: 600;
}
.mm-breadcrumb-btn[aria-current="page"]:hover {
  background: none;
  text-decoration: none;
}

/* ============================================================
   Section 12: タグフィルタセクション（左列内）
   ============================================================ */
.mm-filter-section {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  padding: 0.625rem 0.75rem;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}
.mm-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  align-items: flex-start;
}
.mm-filter-group {
  flex: 1;
  min-width: 110px;
}
.mm-filter-group fieldset {
  border: none;
  padding: 0;
  margin: 0;
}
.mm-filter-label {
  font-size: 0.625rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
  display: block;
  padding: 0;
}
.mm-filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.mm-tag-btn {
  padding: 0.1875rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 1.25rem;
  background: #fff;
  color: #374151; /* 7.5:1 ✓ */
  font-size: 0.6875rem;
  cursor: pointer;
  transition: all 0.12s;
  line-height: 1.5;
  font-family: inherit;
}
.mm-tag-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}
.mm-tag-btn:focus-visible {
  outline: 3px solid rgba(220, 118, 0, 0.5);
  outline-offset: 2px;
}
.mm-tag-btn.mm-tag-active {
  background: #dc7600;
  border-color: #dc7600;
  color: #fff;
  font-weight: 600;
}
.mm-tag-btn.mm-tag-active:hover {
  background: #b85e00;
}
.mm-filter-clear {
  align-self: center;
  padding: 0.1875rem 0.625rem;
  border: 1px solid #ef4444;
  border-radius: 0.25rem;
  background: none;
  color: #b91c1c; /* 5.8:1 on #f9fafb ✓ */
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s;
  font-family: inherit;
}
.mm-filter-clear:hover {
  background: rgba(239, 68, 68, 0.08);
}
.mm-filter-clear:focus-visible {
  outline: 3px solid rgba(239, 68, 68, 0.4);
  outline-offset: 2px;
}
.mm-filter-status {
  font-size: 0.6875rem;
  color: #6b7280;
  margin-top: 0.375rem;
  min-height: 1em;
}

/* フィルタリングで非表示にするL2アイテム */
.mm-filtered {
  display: none !important;
}

/* ============================================================
   Section 13: 詳細パネル プレースホルダー強化
   ============================================================ */
.mm-detail-placeholder-wrap {
  text-align: center;
  padding: 3.75rem 1.25rem;
  color: #9ca3af;
}
.mm-detail-placeholder-icon {
  font-size: 1.75rem;
  opacity: 0.3;
  margin-bottom: 0.5rem;
}
.mm-detail-placeholder-hint {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 0.25rem;
}

/* ============================================================
   Section 14: L3 ラジアルバーストアニメーション
   ============================================================ */
.mm-l3-list > li {
  transition: opacity 0.35s ease-out,
              transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition-delay: var(--burst-delay, 0s);
}

.mm-l3-list > li.mm-burst-from {
  opacity: 0;
  transform: translate(var(--burst-x, 0px), var(--burst-y, -12px)) scale(0.85);
}

/* ============================================================
   Section 15: prefers-reduced-motion
   ============================================================ */
/* ============================================================
   Section 16: Dark Mode
   ============================================================ */

[data-theme="dark"] .mm-nav-col {
  background: var(--ds-bg-card, #1E293B);
}

[data-theme="dark"] .mm-detail-col {
  background: var(--ds-bg, #0F172A);
}

[data-theme="dark"] .mm-resize-handle {
  background: var(--ds-border, #334155);
}

[data-theme="dark"] .mm-node-btn {
  background: var(--ds-bg-card, #1E293B);
  color: var(--ds-text-secondary, #CBD5E1);
  border-color: var(--ds-border, #334155);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .mm-node-btn:hover {
  background: #334155;
  border-color: #475569;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .mm-l1-btn {
  background: #0F172A;
  color: #F1F5F9;
  border-color: #334155;
}

[data-theme="dark"] .mm-l1-btn:hover {
  background: #1E293B;
  border-color: #475569;
}

[data-theme="dark"] .mm-l1-btn.mm-selected {
  background: #dc7600;
  color: #fff;
  border-color: #dc7600;
}

[data-theme="dark"] .mm-l2-btn {
  border-left-color: #475569;
}

[data-theme="dark"] .mm-l2-btn:hover {
  border-left-color: #dc7600;
}

[data-theme="dark"] .mm-l3-btn {
  background: var(--ds-bg-card, #1E293B);
  border-color: var(--ds-border, #334155);
}

[data-theme="dark"] .mm-l3-btn:hover {
  background: #334155;
}

[data-theme="dark"] .mm-node-btn.mm-selected {
  background: rgba(220, 118, 0, 0.12);
  border-color: #dc7600;
}

[data-theme="dark"] .mm-node-btn.mm-search-match {
  background: rgba(202, 138, 4, 0.15);
  border-color: #ca8a04;
}

/* Connector lines */
[data-theme="dark"] .mm-node-children::before {
  background: #475569;
}

[data-theme="dark"] .mm-node-children > ul {
  border-left-color: rgba(71, 85, 105, 0.4);
}

[data-theme="dark"] .mm-node-children > ul > li::before {
  background: #475569;
}

/* Detail panel */
[data-theme="dark"] .mm-detail-header {
  border-bottom-color: var(--ds-border, #334155);
}

[data-theme="dark"] .mm-detail-name-ja {
  color: var(--ds-text, #F1F5F9);
}

[data-theme="dark"] .mm-detail-name-en {
  color: var(--ds-text-tertiary, #94A3B8);
}

[data-theme="dark"] .mm-detail-desc {
  color: var(--ds-text-secondary, #CBD5E1);
}

[data-theme="dark"] .mm-axis-tag {
  background: rgba(3, 105, 161, 0.15);
  color: #7DD3FC;
}

[data-theme="dark"] .mm-crosslink-section {
  background: rgba(37, 99, 235, 0.06);
  border-color: var(--ds-border, #334155);
}

[data-theme="dark"] .mm-html-resources {
  background: rgba(22, 101, 52, 0.08);
  border-color: var(--ds-border, #334155);
}

[data-theme="dark"] .mm-html-resources-label {
  color: #86EFAC;
}

[data-theme="dark"] .mm-html-resource-link {
  color: #86EFAC;
}

[data-theme="dark"] .mm-html-resource-link:hover {
  color: #BBF7D0;
}

/* Breadcrumb */
[data-theme="dark"] .mm-breadcrumb-bar {
  background: var(--ds-bg-card, #1E293B);
  border-bottom-color: var(--ds-border, #334155);
}

[data-theme="dark"] .mm-breadcrumb-btn[aria-current="page"] {
  color: var(--ds-text, #F1F5F9);
}

/* Filter section */
[data-theme="dark"] .mm-filter-section {
  background: var(--ds-bg-inset, #0F172A);
  border-color: var(--ds-border, #334155);
}

[data-theme="dark"] .mm-tag-btn {
  background: var(--ds-bg-card, #1E293B);
  color: var(--ds-text-secondary, #CBD5E1);
  border-color: var(--ds-border, #334155);
}

[data-theme="dark"] .mm-tag-btn:hover {
  background: #334155;
  border-color: #475569;
}

/* Search */
[data-theme="dark"] .concept-search-input {
  background: var(--ds-bg-card, #1E293B);
  color: var(--ds-text, #F1F5F9);
  border-color: var(--ds-border, #334155);
}

/* Tab bar (mobile) */
@media (max-width: 900px) {
  [data-theme="dark"] .mm-tab-bar {
    background: var(--ds-bg-card, #1E293B);
    border-bottom-color: var(--ds-border, #334155);
  }

  [data-theme="dark"] .mm-tab {
    color: var(--ds-text-tertiary, #94A3B8);
  }
}

/* Visual language chips */
[data-theme="dark"] .mm-vis-toggle-btn {
  color: var(--ds-text, #F1F5F9);
  border-bottom-color: var(--ds-border, #334155);
}

[data-theme="dark"] .mm-vis-option-card {
  background: var(--ds-bg-card, #1E293B);
  border-color: var(--ds-border, #334155);
}

[data-theme="dark"] .mm-vis-option-name strong {
  color: var(--ds-text, #F1F5F9);
}

[data-theme="dark"] .mm-vis-pros li,
[data-theme="dark"] .mm-vis-cons li {
  color: var(--ds-text-secondary, #CBD5E1);
}

[data-theme="dark"] .mm-vis-step-text {
  color: var(--ds-text-secondary, #CBD5E1);
}

[data-theme="dark"] .mm-vis-step-q {
  color: var(--ds-text, #F1F5F9);
}

[data-theme="dark"] .mm-vis-branch-yes {
  background: rgba(22, 101, 52, 0.15);
  color: #86EFAC;
}

[data-theme="dark"] .mm-vis-branch-no {
  background: rgba(153, 27, 27, 0.15);
  color: #FCA5A5;
}

/* ============================================================
   Section 15: prefers-reduced-motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .mm-node-children,
  .mm-node-children.mm-enter-from,
  .mm-node-children.mm-leave-to,
  .mm-l3-list > li,
  .mm-l3-list > li.mm-burst-from,
  .mm-node-btn,
  .mm-arrow {
    transition-duration: 0s !important;
    animation-duration: 0s !important;
    transition-delay: 0s !important;
  }
  .mm-l3-list > li.mm-burst-from {
    opacity: 1;
    transform: none;
  }
  .mm-node-btn.mm-highlight {
    animation: none;
    box-shadow: 0 0 0 3px rgba(220, 118, 0, 0.5);
  }
  .mm-l1-focused-out {
    transition-duration: 0s !important;
  }
}
