/* マップ専用スタイル（スタンドアロン HTML 用） */

/* ───── デザイントークン (一括編集用: 値だけここで差し替える) ───── */
:root {
  /* 汎用面色 */
  --dra-bg-page: #f9fafb;
  --dra-bg-card: #fff;
  --dra-bg-accent: #f5f3ff;

  /* テキスト */
  --dra-text-primary: #1f2937;
  --dra-text-muted: #6b7280;

  /* ボーダー・分割線 */
  --dra-border: #e5e7eb;
  --dra-border-strong: #d1d5db;

  /* アクセント (ブランド紫系) */
  --dra-accent: #5b21b6;
  --dra-accent-soft: #ede9fe;
  --dra-accent-strong: #4c1d95;

  /* 状態 (成功・警告・注意) */
  --dra-warn-bg: #fffbeb;
  --dra-warn-border: #fde68a;

  /* 余白・角丸 */
  --dra-gap-sm: 6px;
  --dra-gap-md: 10px;
  --dra-radius-sm: 6px;
  --dra-radius-md: 8px;
}

/* ───── リセット & ベース ───── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  /* 各 OS 標準のゴシック体を優先 (追加 Web リクエストなし)。
     macOS/iOS = Hiragino Sans, Win10+ = Yu Gothic UI, Android = system-ui (Roboto+Noto CJK)。 */
  font-family: "Hiragino Sans",
               "Yu Gothic UI", "Yu Gothic", Meiryo,
               system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: #1f2937;
  background: #f9fafb;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

/* 段落テキスト共通スタイル (加藤さん指示 2026-07-25、weight は 400 で統一) */
p {
  font-size: 15px;
  line-height: 1.6;
  color: #222;
  font-weight: 400;
  letter-spacing: 0.100em;
  font-feature-settings: "palt";
}

/* ───── ヘッダー (加藤さん指示 2026-07-25: 2 カラム構成) ─────
   左カラム: DRAMAP ロゴ
   右カラム 上部: マップ名 + 生成日時
   右カラム 下部: 氏名 / 関係性 / 時間軸 (テーブル組) */
.map-header {
  padding: 10px 20px;
  background: #fff;
  /* 加藤さん指示 2026-07-29: border は bottom のみに */
  border-bottom: 1px solid #e5e7eb;
  /* 加藤さん指示 2026-07-25: border-radius なし */
  /* 加藤さん指示 2026-07-29: map-name を center に分離 (3 カラム化) */
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 20px;
  align-items: center;
  /* 加藤さん指示 2026-07-28: モバイル時 mh-header-slot (absolute) の基準 */
  position: relative;
}
.map-header-center {
  display: flex;
  align-items: center;
  min-width: 0;
}
/* 左カラム: DRAMAP ロゴ + 下にマップ名 (縦積み)。生成日は右カラムのテーブル最上部へ */
.map-header-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
/* 加藤さん指示 2026-08-28: ロゴから公式サイトへ (別タブ)。
   見た目は変えず、リンクであることは hover でだけ示す */
.map-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  color: inherit;
  text-decoration: none;
}
.map-brand:hover { opacity: .7; }
.map-brand:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
  border-radius: 3px;
}
/* 加藤さん指示 2026-07-28: h1 は EB Garamond、真下にふりがな「ドラマップ」を配置 (両端揃え) */
.map-h1-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  margin-bottom: 4px;
}
.map-header-left h1 {
  margin: 0;
  font-family: 'EB Garamond', 'Cormorant Garamond', 'Times New Roman', serif;
  font-size: 36px;
  font-weight: 600;
  letter-spacing: 0;
  color: #222;
  line-height: 1;
}
.map-h1-ruby {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 10px;
  font-weight: 800;
  color: #222;
  line-height: 1;
  margin: 0 10px 0 5px;
  /* 各文字が均等割で並ぶ */
  padding: 0 2px;
}
.map-h1-ruby > span { display: inline-block; }
/* 加藤さん指示 2026-07-28: DRAMAP の上に小さく配置するタグライン */
.map-tagline {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: #222;
  letter-spacing: 0.08em;
  line-height: 1.2;
}
.map-header-right {
  /* 加藤さん指示 2026-07-28: 水平配置、mh-header-slot を右端に (map-header-info は左) */
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  text-align: right;
  flex-wrap: wrap;
}
.map-header-right .mh-header-slot { order: 2; }
.map-header-right .map-header-info { order: 1; }
.map-header-top {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
/* マップ名 (analysis.title) — 加藤さん指示 2026-07-29 */
.map-name {
  display: inline-block;
  padding: 5px 10px;
  font-size: 15px;
  font-weight: 600;
  color: #222;
  background: #eee;
  border-radius: 4px;
  letter-spacing: 0.03em;
  line-height: 1.4;
}
.map-generated {
  color: #6b7280;
  font-size: 15px;
}
/* 加藤さん指示 2026-07-27: font-size 12px、border 削除 */
.map-header-info {
  border-collapse: collapse;
  font-size: 12px;
}
.map-header-info th, .map-header-info td {
  padding: 4px 6px;
  border: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: middle;
}
.map-header-info th {
  background: #f9fafb;
  color: #6b7280;
  font-weight: 500;
  white-space: nowrap;
}
.map-header-info td {
  background: #fff;
  color: #1f2937;
}
@media (max-width: 600px) {
  /* 加藤さん指示 2026-07-25: スマホ幅は 1 カラム縦積み */
  /* 加藤さん指示 2026-07-29: モバイル gap は 5px に縮小 */
  .map-header {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  .map-header-center {
    justify-content: flex-start;
  }
  .map-header-right {
    align-items: stretch;
  }
  .map-header-info {
    width: 100%;
  }
  /* 加藤さん指示 2026-07-30: モバイル位置調整 */
  .mh-header-slot {
    position: absolute;
    top: 16px;
    right: 14px;
    z-index: 10;
    margin: 0;
  }
}
.map-subtitle {
  margin: 0;
  font-size: 12px;
  color: var(--dra-text-muted);
}

/* ヘッダー右側のカテゴリ/時間軸バッジ */
.map-meta {
  margin-left: auto;
}
/* 加藤さん指示 2026-07-25: 「関係性：家族、時間軸：これまでとこれから」形式 */
.map-meta-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--dra-text-primary);
  white-space: nowrap;
}

/* ───── メイン ───── */
.map-main {
  padding: 16px;
  /* 加藤さん指示 2026-07-28: 最大幅 1100px + 中央寄せ */
  max-width: 1100px;
  margin: 0 auto;
}

/* ───── 集計サマリー ───── */
.map-summary {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.map-summary-narrative {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px 18px;
  margin: 0 auto 16px;
  /* 加藤さん指示 2026-07-28: map-main と揃えて 1100px */
  max-width: 1100px;
}
.map-summary-narrative .msn-block {
  margin-bottom: 12px;
}
.map-summary-narrative .msn-block:last-child { margin-bottom: 0; }

/* 加藤さん指示 2026-07-29: マップガイド 1 行目に配置する基本情報 (生成日/関係性/時間軸)。
   横並び、控えめに区切って inline 表示 */
.map-summary-narrative .msn-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 16px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 12px;
  color: #4b5563;
}
.map-summary-narrative .msn-meta-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}
.map-summary-narrative .msn-meta-label {
  color: #9ca3af;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.03em;
}
.map-summary-narrative .msn-meta-value {
  color: #1f2937;
  font-weight: 500;
}

/* 加藤さん指示 2026-07-25: タブスタイル (msn-tab-*) は mp-tab-* を踏襲して共通化 */
.map-summary-narrative .msn-tabs {
  display: flex;
  flex-wrap: wrap;
  position: relative;
}
.map-summary-narrative .msn-tab-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.map-summary-narrative .msn-tab-buttons {
  display: flex;
  gap: 4px;
  width: 100%;
  margin-bottom: 12px;
  border-bottom: 1px solid #d1d5db;
  flex-wrap: nowrap;
}
.map-summary-narrative .msn-tab-button {
  /* mp-tab-button と同一スタイル (均等幅、map-stage 外は 15px 統一) */
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  padding: 8px 16px;
  font-size: 15px;
  color: #6b7280;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  user-select: none;
  position: relative;
  bottom: -1px;
  white-space: nowrap;
}
.map-summary-narrative .msn-tab-button:hover { background: #f3f4f6; }
.map-summary-narrative .msn-tab-panel {
  display: none;
  width: 100%;
  padding: 4px 0;
}
.map-summary-narrative .msn-tab-radio-people:checked ~ .msn-tab-buttons .msn-tab-button-people,
.map-summary-narrative .msn-tab-radio-guidance:checked ~ .msn-tab-buttons .msn-tab-button-guidance {
  background: #fff;
  color: #1f2937;
  font-weight: 600;
  border-color: #d1d5db;
  border-bottom: 2px solid #fff;
}
.map-summary-narrative .msn-tab-radio-people:checked ~ .msn-tab-panel-people,
.map-summary-narrative .msn-tab-radio-guidance:checked ~ .msn-tab-panel-guidance {
  display: block;
}
/* 見出しと本文はサイズ同等、weight で差を出す (加藤さん指示 2026-07-25) */
.map-summary-narrative .msn-heading {
  margin: 0 0 4px 0;
  font-weight: 600;
  color: #222;
  /* font-size / line-height / letter-spacing / font-feature-settings は p 共通スタイル継承 */
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: 0.100em;
  font-feature-settings: "palt";
}
.map-summary-narrative p {
  margin: 0;
  font-weight: 400;
  /* サイズ・行間・字間・パレットは p 共通スタイルを使用 */
}
.summary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin: 4px 0;
}
.summary-label {
  font-weight: 600;
  color: #4b5563;
  margin-right: 4px;
  min-width: 64px;
}
.summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: #f3f4f6;
  border-radius: 999px;
  font-size: 12.5px;
  color: #1f2937;
}
.summary-pill b { font-weight: 600; }
.summary-pill-accent {
  background: #fef3c7;
  color: #92400e;
}
.summary-pill-muted {
  background: #f9fafb;
  color: #9ca3af;
}

/* ───── マップステージ (h_光の計算 style と統一) ───── */
/* 横は auto (カードが収まらない狭い viewport でのみ横スクロールバー),
   縦は hidden で SVG (.map-lines) の外部描画を封じ、body scrollHeight の膨張を防ぐ。
   SVG 内の描画座標は stage 基準なので、hidden でも内容は見える。 */
.map-stage {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 32px 40px;
  margin: 12px 0;
  position: relative;
  min-height: 480px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.map-row {
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 24px;
  min-width: max-content;
  min-height: 130px;
  position: relative;
  padding: 28px 0;
  /* pointer-events: none にして SVG のラベルへクリックを通す */
  pointer-events: none;
}
.map-row > * { pointer-events: auto; }
.map-row-label {
  position: absolute;
  left: 6px; top: 0;
  font-size: 10px;
  color: #9ca3af;
  font-weight: 600;
  letter-spacing: 0.1em;
}
.map-row.row-top,
.map-row.row-middle {
  border-bottom: 1px dashed #e5e7eb;
}
.map-row.row-middle {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: stretch;
  justify-content: center;
}
.map-row.row-middle .mid-zone {
  display: flex;
  gap: 24px;
  flex-wrap: nowrap;
  align-items: stretch;
}
.map-row.row-middle .mid-left   { justify-content: flex-end; }
.map-row.row-middle .mid-center { justify-content: center; }
.map-row.row-middle .mid-right  { justify-content: flex-start; }

/* ───── 人物カード ───── */
.person-card {
  background: #fff;
  border: 3px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 14px;
  min-width: 180px;
  max-width: 220px;
  text-align: center;
  position: relative;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.person-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.person-card:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}
.person-card.self {
  border-width: 4px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}
.card-role {
  font-size: 11px;
  color: #6b7280;
  font-weight: 600;
  margin-bottom: 2px;
}
.card-name {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 2px;
}
.card-date {
  font-size: 10.5px;
  color: #9ca3af;
  margin-bottom: 6px;
}
.card-grid { position: relative; }
.card-mark {
  position: absolute;
  top: 48%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  color: #1f2937;
  line-height: 1;
  pointer-events: none;
  z-index: 1;
}
.card-row-a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 2px auto 6px;
  width: 60px;
}
.card-chip-a,
.card-chip-b,
.mh-trait-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(0,0,0,0.08);
  user-select: none;
}
.mh-trait-chip { margin-right: 4px; vertical-align: middle; }
.card-row-b {
  display: flex;
  gap: 4px;
  justify-content: center;
  align-items: flex-start;
  margin: 2px 0 6px;
}
.card-row-b > .card-chip-b:nth-child(2) {
  margin-top: 20px;
}
.card-stars {
  margin-top: 4px;
  text-align: center;
}
.card-stars-inner {
  letter-spacing: 1px;
  font-size: 13px;
  line-height: 1;
}
.card-stars-inner .star-filled { color: #d97706; }
.card-stars-inner .star-empty  { color: #e5e7eb; }

/* ───── SVG マップ線（汎用パターン pa/pb/pc/pd/pe） ─────
   線色は全パターン統一（黒）、動きと破線スタイルで識別。
   pa: 実線+パルス／pb,pc: 破線+流れアニメ／pd: 破線+スイング／pe: 独立ドット */
.map-lines {
  position: absolute;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}
.map-lines .mp-line {
  stroke: #1f2937;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* pa: 実線・強いパルス */
.map-lines .mp-line.mp-pa {
  stroke-dasharray: none;
  animation: mp-pulse 2.4s ease-in-out infinite;
}
@keyframes mp-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}

/* pb / pc: 破線 */
.map-lines .mp-line.mp-pb,
.map-lines .mp-line.mp-pc {
  stroke-dasharray: 8 6;
}

/* mp-anim-1 / mp-anim-2: dashoffset を動かす（向き別） */
.map-lines .mp-line.mp-anim-1 { animation: mp-anim-1 0.8s linear infinite; }
.map-lines .mp-line.mp-anim-2 { animation: mp-anim-2 0.8s linear infinite; }
@keyframes mp-anim-1 { to { stroke-dashoffset: -14; } }
@keyframes mp-anim-2 { to { stroke-dashoffset:  14; } }

/* pd: 破線 + 左右スイング */
.map-lines .mp-line.mp-pd {
  stroke-dasharray: 8 6;
  animation: mp-swing 3.2s ease-in-out infinite;
}
@keyframes mp-swing {
  0%, 100% { stroke-dashoffset: 0; }
  25%      { stroke-dashoffset: -25; }
  50%      { stroke-dashoffset: 0; }
  75%      { stroke-dashoffset: 25; }
}

/* pe: 個別ドット、バラバラに点滅 */
.map-lines .mp-dot {
  fill: #1f2937;
  animation: mp-blink 2.5s ease-in-out infinite;
}
@keyframes mp-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.1; }
}

/* 矢印 */
.map-lines .mp-arrow {
  fill: #1f2937;
  stroke: #fff;
  stroke-width: 1;
}

/* ラベル箱 (加藤さん指示 2026-07-30: カプセル型・役の色背景・境界線なし) */
.map-lines .mp-tag-rect {
  fill: #fff;
  stroke: none;
  opacity: 1;
}
.map-lines .mp-tag-text {
  font-size: 12px;
  font-weight: 600;
  fill: #fff;
  font-family: "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
/* 加藤さん指示 2026-07-28: ラベルクリックで説明モーダル。
   .map-lines は pointer-events: none だが、ラベルグループだけ auto に戻してクリック可能に。 */
.map-lines .mp-tag-group[data-modal-target] {
  cursor: pointer;
  pointer-events: auto;
}
.map-lines .mp-tag-group[data-modal-target]:hover .mp-tag-rect,
.map-lines .mp-tag-group[data-modal-target]:focus .mp-tag-rect {
  stroke: #fbbf24;
  stroke-width: 2;
}
.map-lines .mp-tag-group[data-modal-target]:focus { outline: none; }

/* ───── カードホバー時のハイライト絞り込み ───── */
/*   .map-stage.is-hovering 状態で:
     - self と対象カードだけ通常表示、それ以外はカード薄く
     - 対象 person に紐づく SVG 要素 (data-conn-for="<pid>") だけ通常表示、
       それ以外の線・矢印・タグは薄く */
.map-stage .person-card,
.map-lines > * {
  transition: opacity 0.15s ease;
}
.map-stage.is-hovering .person-card {
  opacity: 0.18;
}
.map-stage.is-hovering .person-card.self,
.map-stage.is-hovering .person-card.is-hover-target {
  opacity: 1;
}
.map-stage.is-hovering .map-lines > * {
  opacity: 0.1;
}
.map-stage.is-hovering .map-lines > .is-conn-active {
  opacity: 1;
}
/* opacity を動的制御するアニメ (mp-pa=mp-pulse, mp-dot=mp-blink) は
   単純な opacity 指定では上書きされるので、非対象時はアニメを停止して固定減光する。
   stroke-dashoffset だけ動かすアニメ (mp-anim-1/2, mp-pd=mp-swing) は
   opacity に触らないので上のルールだけで減光される。 */
.map-stage.is-hovering .map-lines .mp-pa:not(.is-conn-active),
.map-stage.is-hovering .map-lines .mp-dot:not(.is-conn-active) {
  animation: none;
  opacity: 0.1;
}

/* ───── モーダル ───── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal.hidden { display: none; }
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
}
.modal-content {
  position: relative;
  background: #fff;
  border-radius: 10px;
  padding: 24px 28px;
  max-width: 640px;
  width: calc(100% - 32px);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
/* 加藤さん指示 2026-07-28: ライン ラベル説明モーダル用の狭幅バリアント */
.modal-content-narrow { max-width: 420px; padding: 22px 24px; }
.line-label-modal-heading {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 600;
  color: #222;
  letter-spacing: 0.03em;
}
.line-label-modal-body p {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.6;
  color: #222;
}
.line-label-modal-body p:last-child { margin-bottom: 0; }
.modal-close {
  position: absolute;
  top: 8px; right: 12px;
  background: transparent;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #6b7280;
  padding: 4px 8px;
  line-height: 1;
}
.modal-close:hover { color: #1f2937; }
.modal-title {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 600;
  padding-right: 32px;
}

/* タブ内ラッパー */
.tab-block { padding: 4px 0; }

/* タブ系・ナラティブ系の詳細スタイルは profile-sections.css に集約 */

/* ───── モバイル ───── */
@media (max-width: 600px) {
  .map-header { padding: 16px 14px 10px; }
  .map-main { padding: 12px; }
  /* 加藤さん指示 2026-07-25: スマホ幅は padding を圧縮、mid-zone gap も row と揃える */
  .map-stage { padding: 12px 12px; }
  .map-row { gap: 14px; padding: 20px 0; min-height: 110px; }
  .map-row.row-middle .mid-zone { gap: 14px; }
  .person-card {
    min-width: 140px;
    max-width: 180px;
    padding: 8px 10px;
    font-size: 11.5px;
  }
  .card-name { font-size: 13px; }
  .modal-content { padding: 18px 16px; }
}

/* ─── 時間軸長文セクション (Phase T v2 モーダル内) ─────────────
   スタイルは nv-paragraph 系と揃える: 余白・背景色・ボーダー無し */
.tn-in-modal {
  margin: 0 0 1.2em;
}
.tn-modal-title {
  display: block;
  font-size: 15px;
  color: #1f2937;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 6px 0 2px;
}
/* .tn-modal-subtitle は不要のため削除 (加藤さん指示 2026-07-25) */
.tn-subtitle {
  margin: 0 0 12px;
  font-size: 13px;
  color: #6b7280;
  letter-spacing: 0.02em;
  font-weight: 500;
}
.tn-child-notice {
  margin: 8px 0 12px;
  padding: 8px 12px;
  font-size: 12.5px;
  color: #6b7280;
  background: #f3f4f6;
  border-left: 3px solid #cbd5e1;
  border-radius: 4px;
  line-height: 1.6;
}
.tn-section {
  margin: 0.8em 0;
}
.tn-heading {
  display: block;
  font-weight: 600;
  color: #1f2937;
  font-size: 17px;
  letter-spacing: 0.02em;
  margin: 6px 0 2px;
}
/* 加藤さん指示 2026-07-28: ストーリー slot 別見出し装飾 */
.tn-heading-exp,
.tn-heading-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 4px;
}
.tn-heading-text {
  font-weight: 600;
  color: #1f2937;
  font-size: 1em;
  letter-spacing: 0.02em;
}
/* スロット ラベル チップ (深層 / まとめ / 関わり方) */
.tn-slot-label {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #4b5563;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  letter-spacing: 0.05em;
  line-height: 1.3;
}
/* EXP 色チップペア (dp-chip 系スタイルを .tn-in-modal でも有効化) */
.tn-pair-chips {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.tn-pair-connector {
  font-size: 14px;
  color: #6b7280;
  font-weight: 600;
}
.tn-in-modal .dp-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(0,0,0,0.08);
  user-select: none;
}
.tn-in-modal .dp-chip-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  vertical-align: middle;
}
.tn-in-modal .dp-chip-role {
  font-size: 10px;
  color: #6b7280;
  line-height: 1;
  letter-spacing: 0.5px;
}
/* 加藤さん指示 2026-07-28: 時間軸見出し (これまでのこと / これからのこと) */
.tn-axis-heading {
  display: block;
  font-size: 19px;
  font-weight: 600;
  color: #1f2937;
  letter-spacing: 0.03em;
  margin: 22px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid #e5e7eb;
}
.tn-axis-heading:first-child { margin-top: 4px; }
.tn-text {
  margin: 2px 0 14px;
  /* 加藤さん指示 2026-07-25: font-size / color / line-height は共通 p スタイルに準拠 */
}

/* ═══════════════════════════════════════════════════════════════════════
   加藤さん指示 2026-07-28: マップ ヘルプガイド (バーガー + ドロワー式)
   ── 6 ページ、ChatGPT 精査反映
   ═══════════════════════════════════════════════════════════════════════ */

/* ── ヘッダー内スロット ── */
.mh-header-slot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
/* ── バーガー / 見方ボタン ── */
.mh-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 12px;
  background: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: 24px;
  cursor: pointer;
  font-size: 20px;
  color: #1f2937;
  transition: background 0.15s, border-color 0.15s;
}
.mh-toggle:hover { background: #f3f4f6; border-color: #9ca3af; }
.mh-toggle:focus-visible { outline: 2px solid #6366f1; outline-offset: 2px; }
.mh-toggle-icon { font-size: 15px; line-height: 1; }
.mh-toggle-label { font-weight: 500; line-height: 1; font-size: 15px; }

/* ── ドロワー本体 ── */
.mh-drawer {
  position: fixed;
  inset: 0;
  z-index: 1050;
}
.mh-drawer.hidden { display: none; }
.mh-drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.4);
}
.mh-drawer-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(420px, 100vw);
  background: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.15);
  animation: mh-slide-in 0.22s ease-out;
  padding-bottom: env(safe-area-inset-bottom);
  outline: none;
}
@keyframes mh-slide-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .mh-drawer-panel { animation: none; }
}

/* ── ドロワー ヘッダー ── */
.mh-drawer-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  flex: 0 0 auto;
}
.mh-drawer-back,
.mh-drawer-close {
  min-width: 32px;
  min-height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 15px;
  color: #4b5563;
  border-radius: 6px;
  padding: 4px 8px;
  line-height: 1;
}
.mh-drawer-back:hover,
.mh-drawer-close:hover { background: #f3f4f6; }
.mh-drawer-back:focus-visible,
.mh-drawer-close:focus-visible { outline: 2px solid #6366f1; outline-offset: 2px; }
.mh-drawer-back.hidden { visibility: hidden; }
.mh-drawer-title {
  flex: 1 1 auto;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  text-align: center;
}

/* ── ドロワー ボディ ── */
.mh-drawer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px;
}

/* ── 目次 ── */
.mh-toc.hidden { display: none; }
.mh-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
}
.mh-toc li {
  margin-bottom: 8px;
}
.mh-toc-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 14px 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  color: #1f2937;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.mh-toc-item:hover { background: #f3f4f6; border-color: #9ca3af; }
.mh-toc-item:focus-visible { outline: 2px solid #6b7280; outline-offset: 2px; }

/* ── ページ (全テキスト 15px 統一 - 加藤さん指示 2026-07-28) ── */
.mh-page.hidden { display: none; }
.mh-page-body {
  font-size: 15px;
  line-height: 1.7;
  color: #1f2937;
}
.mh-page-body p {
  margin: 0 0 10px;
  font-size: 15px;
}
.mh-page-body h3 {
  margin: 20px 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  padding-bottom: 4px;
  border-bottom: 1px solid #e5e7eb;
}
.mh-page-body h3:first-child { margin-top: 0; }
.mh-page-body h4 {
  margin: 14px 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: #374151;
}
.mh-page-body ul {
  padding-left: 20px;
  margin: 0 0 12px;
}
.mh-page-body li {
  margin-bottom: 4px;
  font-size: 15px;
}
.mh-page-body strong { color: #111827; font-weight: 600; }

/* ── term - def 型リスト (加藤さん指示 2026-07-28)
   同一 ul 内で mh-def の行頭を揃える。
   - UL 自体を grid コンテナに、LI を display:contents で無視。
   - 全 <li> の <span.mh-term> / <span.mh-def> が UL の 2 カラム grid に直接並ぶ。
   - 結果、UL 内で最も広い term に合わせて全 def が同列から開始。
   - 繋げる記号「—」は mh-term の ::after として term カラム内に配置し、
     term 側の幅計算に含める (mh-def 側にはみ出さない)。 */
.mh-page-body ul.mh-def-list {
  list-style: none;
  padding-left: 0;
  margin: 0 0 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0;
  row-gap: 6px;
}
.mh-page-body ul.mh-def-list li {
  display: contents;
}
.mh-page-body ul.mh-def-list .mh-term {
  color: #111827;
  font-weight: 500;
  white-space: nowrap;
  font-size: 15px;
  /* 加藤さん指示 2026-07-28: term はカラム幅いっぱいに広げ、左端に text、右端に dash を配置。
     結果、全行の dash と mh-def の行頭が揃う。 */
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}
.mh-page-body ul.mh-def-list .mh-term::after {
  content: "—";
  color: #9ca3af;
  font-weight: 400;
  flex-shrink: 0;
}
.mh-page-body ul.mh-def-list .mh-def {
  color: #1f2937;
  font-size: 15px;
  padding-left: 12px;
}

/* 加藤さん指示 2026-07-30: 4 つの役の循環図 (Page 3、静的 SVG、アニメーションなし) */
.mh-role-cycle {
  display: flex;
  justify-content: center;
  margin: 20px auto;
  padding: 8px 0;
}
.mh-role-cycle svg {
  width: 100%;
  max-width: 260px;
  height: auto;
  display: block;
}
@media (max-width: 400px) {
  .mh-role-cycle svg { max-width: 220px; }
}

/* ── カテゴリブロック (Page 4) ── */
.mh-cat {
  padding: 12px 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 10px;
}
.mh-cat-heading {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  border: none;
  padding: 0;
}
.mh-cat-body {
  margin: 0 0 0;
  font-size: 15px;
  color: #4b5563;
  line-height: 1.6;
}

/* ── ページ位置 + ナビ ── */
.mh-page-position {
  font-size: 15px;
  color: #6b7280;
  text-align: center;
  margin: 20px 0 12px;
}
.mh-page-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}
.mh-page-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  color: #1f2937;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s;
}
.mh-page-nav-btn .mat-icon { font-size: 18px; line-height: 1; }
.mh-page-nav-btn:hover { background: #f3f4f6; border-color: #9ca3af; }
.mh-page-nav-btn:focus-visible { outline: 2px solid #6b7280; outline-offset: 2px; }
.mh-page-nav-close {
  background: #1f2937;
  color: #fff;
  border-color: #1f2937;
}
.mh-page-nav-close:hover { background: #111827; border-color: #111827; }

/* ── モバイル (520px 以下は全幅 + アイコンのみ) ── */
@media (max-width: 520px) {
  .mh-drawer-panel { width: 100vw; }
  .mh-toggle-label { display: none; }
  .mh-toggle { min-width: 44px; padding: 6px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   加藤さん指示 2026-07-28: 記号 → Google Material Symbols アイコン置換
   ═══════════════════════════════════════════════════════════════════════ */
.mat-icon {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  display: inline-block;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  font-size: 1em;
}

/* サマリー pill 内アイコン */
.summary-pill .mat-icon { font-size: 15px; margin-right: 2px; }

/* カード右下記号 */
.card-mark .mat-icon { font-size: 18px; }

/* ライン ラベル モーダル 見出し内アイコン */
.line-label-modal-heading .mat-icon { font-size: 20px; margin-right: 4px; }

/* ヘルプ カテゴリ 見出し内アイコン */
.mh-cat-heading .mat-icon { font-size: 18px; margin-right: 4px; }

/* ヘルプ本文中の 5 アイコン列 (「線上の記号 ○ ○ △ - ×」の代替) */
.mh-icon-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
  padding: 0 4px;
}
.mh-icon-row .mat-icon { font-size: 16px; color: #4b5563; }

/* 加藤さん指示 2026-07-29: SVG ラベルは foreignObject + HTML flex で描画 (全ブラウザ完全整列)
   背景は役の色 (rect fill、JS 側で inline)、文字色は黒統一 */
.map-lines .mp-tag-fo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
  height: 100%;
  color: #1f2937;
  font-size: 12px;
  font-weight: 600;
  font-family: "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, -apple-system, sans-serif;
  line-height: 1;
  user-select: none;
}
.map-lines .mp-tag-fo .mp-tag-icon {
  font-family: 'Material Symbols Outlined';
  font-size: 14px;
  font-weight: normal;
  line-height: 1;
  font-feature-settings: 'liga';
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.map-lines .mp-tag-fo .mp-tag-label {
  line-height: 1;
}

/* ═══════════════════════════════════════════════════════════════════════
   加藤さん指示 2026-07-31: 本人モーダル最下部「4つの役との関わり方」タブ
   ═══════════════════════════════════════════════════════════════════════ */
.rt-section {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}
.rt-section-title {
  margin: 0 0 12px;
  padding: 0;
  border: none;
  font-size: 17px;
  font-weight: 600;
  color: #111827;
  line-height: 1.4;
}
.rt-tabs { position: relative; }
.rt-tabs .rt-tab-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.rt-tab-buttons {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #d1d5db;
  margin-bottom: 12px;
  width: 100%;
}
.rt-tab-button {
  flex: 1 1 0;
  padding: 8px 6px;
  text-align: center;
  color: #6b7280;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  user-select: none;
  position: relative;
  bottom: -1px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.rt-tab-button:hover { background: #f3f4f6; }
.rt-tab-radio-0:checked ~ .rt-tab-buttons .rt-tab-button:nth-of-type(1),
.rt-tab-radio-1:checked ~ .rt-tab-buttons .rt-tab-button:nth-of-type(2),
.rt-tab-radio-2:checked ~ .rt-tab-buttons .rt-tab-button:nth-of-type(3),
.rt-tab-radio-3:checked ~ .rt-tab-buttons .rt-tab-button:nth-of-type(4) {
  background: #fff;
  color: #1f2937;
  font-weight: 600;
  border-color: #d1d5db;
  border-bottom: 2px solid #fff;
}
.rt-tab-panel { display: none; }
.rt-tab-radio-0:checked ~ .rt-tab-panel-0,
.rt-tab-radio-1:checked ~ .rt-tab-panel-1,
.rt-tab-radio-2:checked ~ .rt-tab-panel-2,
.rt-tab-radio-3:checked ~ .rt-tab-panel-3 { display: block; }

.rt-partner {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
}
.rt-tab-panel h4 {
  margin: 16px 0 4px;
  padding: 0;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  line-height: 1.5;
}
.rt-tab-panel p {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.7;
  color: #1f2937;
}
.rt-tab-panel ul {
  margin: 4px 0 0;
  padding-left: 20px;
}
.rt-tab-panel li {
  margin: 3px 0;
  font-size: 14px;
  line-height: 1.7;
  color: #1f2937;
}
@media (max-width: 520px) {
  .rt-tab-button {
    padding: 8px 4px;
    font-size: 12px;
  }
}
