/* ============================================================
   初回チュートリアル（ウェルカムツアー）— TutorialModule.js 用
   ダーク既定 + body.light-mode override の両モード対応。
   色はアプリ汎用（--gold / モーダル #0c1018 / ライト #fff）に合わせる。
   ============================================================ */

.tc-tutorial-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-auth, 10000);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.tc-tutorial-modal.is-open {
  display: flex;
}

.tc-tutorial-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.tc-tutorial-content {
  position: relative;
  max-width: 480px;
  width: 100%;
  max-height: calc(100vh - 32px);
  /* TUTORIAL-100VH-1: iOS Safari はアドレスバー込みの 100vh が可視領域より大きく下端ボタンが届かない。
     dvh(動的ビューポート)対応ブラウザは下行で上書き（非対応は無視＝従来 vh）。 */
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: #0c1018;
  color: #e6e9ef;
  border: 1px solid rgba(212, 165, 32, 0.18);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.tc-tutorial-skip {
  position: absolute;
  top: 14px;
  right: 14px;
  border: none;
  background: transparent;
  color: #8a94a6;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
}

.tc-tutorial-skip:hover {
  color: #e6e9ef;
}

.tc-tutorial-icon {
  font-size: 52px;
  margin-bottom: 14px;
  line-height: 1;
}

.tc-tutorial-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--gold, #d4a520);
}

.tc-tutorial-body {
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 22px;
  text-align: left;
  color: #e6e9ef;
  background: rgba(255, 255, 255, 0.04);
  padding: 16px;
  border-radius: 8px;
}

.tc-tutorial-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 20px;
}

.tc-tutorial-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: transform 0.15s ease;
}

.tc-tutorial-dot.is-active {
  background: var(--gold, #d4a520);
  transform: scale(1.3);
}

.tc-tutorial-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.tc-tutorial-prev,
.tc-tutorial-next {
  padding: 10px 20px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: #e6e9ef;
}

.tc-tutorial-prev:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tc-tutorial-prev:not(:disabled):hover,
.tc-tutorial-next:hover {
  background: rgba(255, 255, 255, 0.06);
}

.tc-tutorial-next.tc-tutorial-finish {
  background: var(--gold, #d4a520);
  border-color: var(--gold, #d4a520);
  color: #0c1018;
  font-weight: 700;
}

.tc-tutorial-next.tc-tutorial-finish:hover {
  background: var(--gold-bright, #e8bf3e);
}

.tc-tutorial-progress {
  font-size: 12px;
  color: #8a94a6;
}

/* ---- ライトモード ---- */
body.light-mode .tc-tutorial-content {
  background: #ffffff;
  color: #1a1f2e;
  border: 2px solid #cbb06a;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

body.light-mode .tc-tutorial-body {
  background: #f5f6f8;
  color: #1a1f2e;
}

body.light-mode .tc-tutorial-skip {
  color: #666;
}

body.light-mode .tc-tutorial-skip:hover {
  color: #1a1f2e;
}

body.light-mode .tc-tutorial-title {
  color: var(--gold-rich, #b8860b);
}

body.light-mode .tc-tutorial-prev,
body.light-mode .tc-tutorial-next {
  color: #1a1f2e;
  border-color: #bbb;
}

body.light-mode .tc-tutorial-prev:not(:disabled):hover,
body.light-mode .tc-tutorial-next:hover {
  background: #eeeeee;
}

body.light-mode .tc-tutorial-next.tc-tutorial-finish {
  color: #ffffff;
}

body.light-mode .tc-tutorial-dot {
  background: #cccccc;
}

body.light-mode .tc-tutorial-progress {
  color: #666;
}

/* ---- モバイル ---- */
@media (max-width: 768px) {
  .tc-tutorial-content {
    padding: 24px 20px;
  }
  .tc-tutorial-icon {
    font-size: 44px;
  }
  .tc-tutorial-title {
    font-size: 18px;
  }
}

/* ============================================================
   実画面コーチマーク・ツアー（GuidedTourModule.js 用）
   スポットライト（対象以外を暗く）＋ 吹き出し（矢印つき）。
   ============================================================ */

.tc-tour-root {
  position: fixed;
  inset: 0;
  z-index: 10050; /* 標準モーダル帯(10000-10010)の上・画面ツアー専用。auth を抜けてから起動するので衝突しない */
  pointer-events: auto; /* app 操作をブロック（walk-through 型・前へ/次へ/終了 のみ操作可） */
}

/* 暗幕は 4 枚パネルで対象周囲を覆う（巨大 box-shadow は描画/スクショが重く環境により固まるため不採用） */
.tc-tour-dim {
  position: fixed;
  background: rgba(0, 0, 0, 0.62);
  pointer-events: none;
}

.tc-tour-spotlight {
  position: fixed;
  border-radius: 10px;
  pointer-events: none;
  /* 対象を金のリング＋グローで強調（暗幕は別パネル） */
  box-shadow:
    0 0 0 2px var(--gold, #d4a520),
    0 0 18px 4px rgba(212, 165, 32, 0.45);
  transition: top 0.18s ease, left 0.18s ease, width 0.18s ease, height 0.18s ease;
}

.tc-tour-tooltip {
  position: fixed;
  max-width: 340px;
  width: calc(100vw - 32px);
  box-sizing: border-box;
  background: #0c1018;
  color: #e6e9ef;
  border: 1px solid rgba(212, 165, 32, 0.3);
  border-radius: 12px;
  padding: 18px 18px 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
}

@media (min-width: 480px) {
  .tc-tour-tooltip { width: 340px; }
}

/* 吹き出しの三角（矢印）— 水平位置は JS が --tc-arrow-left で設定 */
.tc-tour-tooltip::after {
  content: '';
  position: absolute;
  left: var(--tc-arrow-left, 24px);
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
}
.tc-tour-tooltip.tc-tour-place-below::after {
  top: -9px;
  border-bottom: 9px solid #0c1018;
}
.tc-tour-tooltip.tc-tour-place-above::after {
  bottom: -9px;
  border-top: 9px solid #0c1018;
}
.tc-tour-tooltip.tc-tour-place-center::after { display: none; }

.tc-tour-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  color: #8a94a6;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
}
.tc-tour-close:hover { color: #e6e9ef; }

.tc-tour-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 8px;
  padding-right: 40px;
  color: var(--gold, #d4a520);
}

.tc-tour-body {
  font-size: 13.5px;
  line-height: 1.7;
  margin-bottom: 16px;
}

.tc-tour-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.tc-tour-prev,
.tc-tour-next {
  padding: 8px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: #e6e9ef;
}
.tc-tour-prev:disabled { opacity: 0.4; cursor: not-allowed; }
.tc-tour-prev:not(:disabled):hover,
.tc-tour-next:hover { background: rgba(255, 255, 255, 0.06); }
.tc-tour-next.tc-tour-finish {
  background: var(--gold, #d4a520);
  border-color: var(--gold, #d4a520);
  color: #0c1018;
  font-weight: 700;
}
.tc-tour-next.tc-tour-finish:hover { background: var(--gold-bright, #e8bf3e); }
.tc-tour-progress { font-size: 12px; color: #8a94a6; }

/* キーボード操作ヒント（← → / Esc）。控えめに表示 */
.tc-tour-hint {
  margin-top: 10px;
  text-align: center;
  font-size: 11px;
  color: #6b7585;
  letter-spacing: 0.02em;
}

/* ---- ライトモード（ツアー）---- */
body.light-mode .tc-tour-dim {
  background: rgba(0, 0, 0, 0.45);
}
body.light-mode .tc-tour-spotlight {
  box-shadow:
    0 0 0 2px var(--gold-rich, #b8860b),
    0 0 18px 4px rgba(184, 134, 11, 0.35);
}
body.light-mode .tc-tour-tooltip {
  background: #ffffff;
  color: #1a1f2e;
  border: 2px solid #cbb06a;
}
body.light-mode .tc-tour-tooltip.tc-tour-place-below::after { border-bottom-color: #ffffff; }
body.light-mode .tc-tour-tooltip.tc-tour-place-above::after { border-top-color: #ffffff; }
body.light-mode .tc-tour-title { color: var(--gold-rich, #b8860b); }
body.light-mode .tc-tour-close { color: #666; }
body.light-mode .tc-tour-close:hover { color: #1a1f2e; }
body.light-mode .tc-tour-prev,
body.light-mode .tc-tour-next { color: #1a1f2e; border-color: #bbb; }
body.light-mode .tc-tour-prev:not(:disabled):hover,
body.light-mode .tc-tour-next:hover { background: #eeeeee; }
body.light-mode .tc-tour-next.tc-tour-finish { color: #ffffff; }
body.light-mode .tc-tour-progress { color: #666; }
body.light-mode .tc-tour-hint { color: #999; }

/* ============================================================
   常設ガイドボタン（GuideButtonModule.js 用）— 画面右下の FAB
   z-index は AI チャットパネル(--z-chat-panel:100)より下に置く。チャットを開いている間や
   各モーダル/ツアー表示中は自然に覆われて見えなくなる（個別の hide ロジックを持たない＝壊れにくい）。
   AI チャットの「ランチャー」は position:sticky の上部バンドなので、右下 FAB と位置が衝突しない。
   ============================================================ */
.tc-guide-fab {
  position: fixed;
  right: 20px;
  /* トースト(.toast bottom:20px)・自動保存インジケーター(.note-autosave-indicator bottom:24px)が
     同じ右下隅に出る（z-index は上）ため、FAB を一段上げて重なり/隠れを避ける。 */
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  /* 「ガイド」の文字は画面の邪魔になるため「?」アイコンのみの丸ボタン（社長実機要望 2026-06-24）。
     幅=高さ＋border-radius:999px で正円。意味は aria-label/title で担保。 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(212, 165, 32, 0.45);
  background: #0c1018;
  color: var(--gold, #d4a520);
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.tc-guide-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  background: #11161f;
}
/* 素の「?」グリフ（#ico-help の丸囲みを使わず FAB の丸と二重丸にしないため・社長要望 2026-06-24） */
.tc-guide-fab-q {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  color: var(--gold, #d4a520);
}

/* ライトモード（body.light-mode * { color:#000 } が SVG 子要素を黒化するため署名色を再宣言） */
body.light-mode .tc-guide-fab {
  background: #ffffff;
  color: var(--gold-rich, #b8860b);
  border: 1px solid #cbb06a;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
body.light-mode .tc-guide-fab:hover {
  background: #fbf7ea;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}
body.light-mode .tc-guide-fab-q {
  /* body.light-mode * { color:#000 } に勝つよう gold を再宣言（FAB と同じ作法） */
  color: var(--gold-rich, #b8860b);
}

/* モバイル: 少しコンパクトに・親指の届く位置 */
@media (max-width: 768px) {
  .tc-guide-fab {
    right: 14px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    width: 44px;
    height: 44px;
  }
}
