/* ============================================
   FXのミカタ - 統合版スタイルシート
   ベース：fxnomikata-style.css（V0デザイン）
   ============================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&family=Noto+Serif+JP:wght@700&display=swap');

/* ---------- CSS変数（カラーパレット） ---------- */
:root {
  --bg-main:        #020617;
  --bg-card:        #0f172a;
  --bg-secondary:   #1e293b;
  --bg-border:      #334155;
  --text-white:     #ffffff;
  --text-light:     #e2e8f0;
  --text-muted:     #94a3b8;
  --text-dim:       #64748b;
  --accent-yellow:  #ffde59;
  --accent-blue:    #3b82f6;
  --accent-green:   #22c55e;
  --accent-red:     #ef4444;
  --accent-amber:   #eab308;
  --led-blue-on:    #3b82f6;
  --led-yellow-on:  #eab308;
  --led-red-on:     #ef4444;
}

/* ---------- ベース ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Noto Sans JP', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-white);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---------- ヘッダー ---------- */
.fxm-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background-color: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #1e293b;
}

.fxm-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fxm-header-logo-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fxm-header-logo {
  height: 32px;
  width: auto;
}

@media (min-width: 768px) {
  .fxm-header-logo { height: 48px; }
}

.fxm-header-icon {
  width: 28px;
  height: 28px;
  color: var(--accent-yellow);
}

.fxm-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fxm-username {
  font-size: 14px;
  color: var(--text-light);
  display: none;
}

@media (min-width: 640px) {
  .fxm-username { display: inline; }
}

.fxm-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.fxm-back-btn:hover {
  background: var(--bg-border);
  color: var(--text-white);
}

.fxm-logout-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.fxm-logout-btn:hover {
  color: var(--accent-red);
}

.fxm-logout-text {
  display: none;
}

@media (min-width: 640px) {
  .fxm-logout-text { display: inline; }
}

/* ---------- メインコンテンツ ---------- */
.fxm-section {
  flex: 1;
  padding: 12px 16px 48px;
}

@media (min-width: 768px) {
  .fxm-section { padding: 24px 16px 80px; }
}

.fxm-container {
  max-width: 672px;
  margin: 0 auto;
}

/* ---------- キャッチコピー ---------- */
.fxm-catchphrase {
  text-align: center;
  margin-bottom: 12px;
  padding: 0 4px;
  animation: fadeInUp 0.5s ease forwards;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .fxm-catchphrase {
    margin-bottom: 24px;
    display: table;
    margin-left: auto;
    margin-right: auto;
    width: auto;
    text-align: left;
  }
}

.fxm-catch-sub {
  font-size: 14px;
  font-weight: 700;
  font-style: italic;
  font-family: 'Noto Serif JP', serif;
  line-height: 1.25;
  color: #ffde59;
}

@media (min-width: 768px) {
  .fxm-catch-sub { font-size: 36px; }
}

.fxm-catch-main {
  font-size: min(22px, 6.5vw);
  font-weight: 700;
  font-style: italic;
  font-family: 'Noto Serif JP', serif;
  margin-top: 0;
  color: #ffde59;
  white-space: nowrap;
  animation: catchphrasePulse 3s ease-in-out infinite;
}

.fxm-catch-main--solo {
  font-size: min(24px, 7vw);
  white-space: nowrap;
}

@media (min-width: 768px) {
  .fxm-catch-main {
    font-size: 36px;
  }
  .fxm-catch-main--solo {
    font-size: 40px;
  }
}

.fxm-catch-small {
  font-size: 0.55em;
  font-weight: 700;
  font-style: italic;
  vertical-align: middle;
}

.fxm-catch-accent {
  font-size: 1.1em;
  font-weight: 900;
  font-style: italic;
  color: #ffde59;
}

/* ---------- セクションタイトル ---------- */
.fxm-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .fxm-section-title { margin-bottom: 20px; }
}

.fxm-section-title h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-white);
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .fxm-section-title h2 { font-size: 24px; }
}

.fxm-realtime-badge {
  margin-left: auto;
  font-size: 11px;
  color: var(--accent-blue);
  background: var(--bg-secondary);
  padding: 3px 7px;
  border-radius: 6px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ---------- 通貨ペアグリッド ---------- */
.fxm-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (min-width: 768px) {
  .fxm-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
}

/* ---------- 通貨カード ---------- */
.fxm-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 2px solid var(--accent-yellow);
  box-shadow: 0 0 12px rgba(255,222,89,0.15);
  cursor: pointer;
  transition: background 0.2s;
  animation: fadeInUp 0.5s ease forwards;
}

.fxm-card:hover {
  background: var(--bg-secondary);
}

@media (min-width: 768px) {
  .fxm-card { padding: 12px; }
}

.fxm-card-pair {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-yellow);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

@media (min-width: 768px) {
  .fxm-card-pair { font-size: 24px; margin-bottom: 8px; }
}

/* GOLD カードのサブテキスト（GOLDデイトレ / GOLDスキャル） */
.fxm-card-sub {
  display: block;
  font-size: 11px;
  font-weight: 700;
  font-style: italic;
  font-family: 'Noto Serif JP', serif;
  color: var(--accent-yellow);
  letter-spacing: 0.04em;
  line-height: 1.0;
  margin-top: -2px;
}

/* 6銘柄とGOLDの区切り線（黄色横線） */
.fxm-gold-divider {
  border: none;
  border-top: 1px solid var(--accent-yellow);
  margin: 16px 0 12px;
  opacity: 0.6;
}

/* ---------- LED信号機 ---------- */
.fxm-led {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  position: relative;
}

@media (min-width: 768px) {
  .fxm-led { width: 24px; height: 24px; }
}

.fxm-led-off {
  background-color: #334155;
}

/* 消灯（薄色）状態 */
.fxm-led-dim-blue {
  background-color: transparent;
  border: 1px solid #3b82f6;
}

.fxm-led-dim-yellow {
  background-color: transparent;
  border: 1px solid #eab308;
}

.fxm-led-dim-red {
  background-color: transparent;
  border: 1px solid #ef4444;
}

/* 3灯コンテナ */
.fxm-leds {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.fxm-led-blue {
  background-color: var(--led-blue-on);
  animation: ledPulseBlue 1.5s ease-in-out infinite;
}

/* blue_pre：ON/OFFを繰り返す速い点滅（予告サイン） */
.fxm-led-blue-pre {
  background-color: var(--led-blue-on);
  animation: ledBlinkBluePre 0.6s step-end infinite;
}

.fxm-led-yellow {
  background-color: var(--led-yellow-on);
  animation: ledPulseYellow 1.5s ease-in-out infinite;
}

.fxm-led-red {
  background-color: var(--led-red-on);
  animation: ledPulseRed 1.5s ease-in-out infinite;
}

/* ---------- 情報ボタン ---------- */
.fxm-info-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}

@media (min-width: 768px) {
  .fxm-info-buttons {
    gap: 12px;
    margin-top: 24px;
  }
}

.fxm-info-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--bg-border);
  cursor: pointer;
  transition: background 0.2s;
  font-family: 'Noto Sans JP', sans-serif;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .fxm-info-btn { padding: 12px; }
}

.fxm-info-btn:hover {
  background: var(--bg-border);
}

.fxm-info-btn span {
  font-size: 12px;
  color: var(--text-light);
}

@media (min-width: 768px) {
  .fxm-info-btn span { font-size: 14px; }
}

.fxm-info-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.icon-blue  { color: var(--accent-blue); }
.icon-amber { color: var(--accent-amber); }
.icon-green { color: var(--accent-green); }

/* ---------- キャンペーンバナー ---------- */
.fxm-banner {
  margin-top: 12px;
  padding: 10px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 2px solid var(--accent-yellow);
  box-shadow: 0 0 12px rgba(255,222,89,0.2);
  cursor: pointer;
  transition: background 0.2s;
  animation: fadeInUp 0.5s ease forwards;
  overflow: hidden;
  max-width: 100%;
}

@media (min-width: 768px) {
  .fxm-banner {
    margin-top: 24px;
    padding: 20px;
  }
}

.fxm-banner:hover {
  background: var(--bg-secondary);
}

.fxm-banner-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

@media (min-width: 768px) {
  .fxm-banner-inner { gap: 8px; }
}

.fxm-banner-logo {
  height: 20px;
  width: auto;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .fxm-banner-logo { height: 40px; }
}

.fxm-banner-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-yellow);
  white-space: nowrap;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .fxm-banner-text { font-size: 20px; }
}

.fxm-banner-icon {
  width: 16px;
  height: 16px;
  color: var(--accent-yellow);
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .fxm-banner-icon { width: 28px; height: 28px; }
}

/* ---------- フッター ---------- */
.fxm-footer {
  margin-top: 32px;
  padding-bottom: 24px;
  text-align: center;
}

.fxm-footer p {
  font-size: 12px;
  color: var(--text-dim);
}

/* ---------- モーダル ---------- */
.fxm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.fxm-modal-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

@media (min-width: 640px) {
  .fxm-modal-overlay {
    align-items: center;
  }
}

.fxm-modal {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(30px);
  transition: transform 0.2s;
}

.fxm-modal-overlay.is-open .fxm-modal {
  transform: translateY(0);
}

.fxm-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--bg-border);
  flex-shrink: 0;
}

.fxm-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-white);
}

.fxm-modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: all 0.2s;
}

.fxm-modal-close:hover {
  background: var(--bg-border);
  color: var(--text-white);
}

.fxm-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.fxm-modal-body p {
  color: var(--text-light);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 16px;
}

.fxm-modal-body h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-yellow);
  margin-bottom: 8px;
}

.fxm-modal-body h5 {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-yellow);
  margin-bottom: 6px;
}

.fxm-modal-box {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.fxm-modal-box p {
  margin-bottom: 0;
}

.fxm-modal-box ul {
  list-style: disc;
  padding-left: 20px;
  color: var(--text-light);
  font-size: 14px;
  line-height: 1.7;
}

.fxm-modal-box strong {
  color: var(--accent-blue);
}

.fxm-faq-item {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.fxm-faq-q {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-yellow);
  margin-bottom: 8px;
}

.fxm-faq-a {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 0 !important;
}

/* ---------- ログインページ ---------- */
.fxm-auth-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.fxm-auth-box {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: 16px;
  padding: 32px 24px;
}

.fxm-auth-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-white);
  text-align: center;
  margin-bottom: 8px;
}

.fxm-auth-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 24px;
}

.fxm-auth-tabs {
  display: flex;
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 24px;
  gap: 4px;
}

.fxm-auth-tab {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  font-family: 'Noto Sans JP', sans-serif;
  transition: all 0.2s;
}

.fxm-auth-tab.active {
  background: var(--bg-card);
  color: var(--text-white);
}

.fxm-form-group {
  margin-bottom: 16px;
}

.fxm-form-label {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.fxm-form-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--bg-border);
  color: var(--text-white);
  font-size: 14px;
  font-family: 'Noto Sans JP', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

.fxm-form-input:focus {
  border-color: var(--accent-blue);
}

.fxm-form-input::placeholder {
  color: var(--text-dim);
}

.fxm-submit-btn {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  background: var(--accent-blue);
  color: var(--text-white);
  border: none;
  font-size: 16px;
  font-weight: 700;
  font-family: 'Noto Sans JP', sans-serif;
  cursor: pointer;
  transition: opacity 0.2s;
  margin-top: 8px;
}

.fxm-submit-btn:hover { opacity: 0.9; }
.fxm-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.fxm-auth-toggle {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-muted);
}

.fxm-auth-toggle a {
  color: var(--accent-blue);
  text-decoration: none;
  cursor: pointer;
}

/* ---------- チャットページ ---------- */
.fxm-chat-section {
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 16px;
}

/* チャット画面アクティブ時：bodyスクロール禁止 */
body.chat-active {
  overflow: hidden;
}

/* チャット画面アクティブ時：全画面固定 */
body.chat-active .fxm-chat-section {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px;
  gap: 6px;
  z-index: 10;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 上部エリア：縮めて内容を隠す */
body.chat-active .fxm-chat-scroll-top {
  flex-shrink: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  max-height: 200px;
}

/* チャットエリアが残り全高さを占有 */
body.chat-active .fxm-chat-area {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* メッセージエリアをスクロール可能に */
body.chat-active .fxm-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.fxm-chat-pair-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-yellow);
}

.fxm-tf-panel {
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: 12px;
  overflow: hidden;
}

.fxm-tf-tabs {
  display: flex;
  border-bottom: 1px solid var(--bg-border);
}

.fxm-tf-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: 'Noto Sans JP', sans-serif;
  transition: all 0.2s;
}

.fxm-tf-tab.active {
  color: var(--text-white);
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--accent-blue);
}

.fxm-tf-content {
  padding: 16px;
}

.fxm-tf-data-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--bg-border);
  font-size: 13px;
}

.fxm-tf-data-row:last-child { border-bottom: none; }

.fxm-tf-label { color: var(--text-muted); }
.fxm-tf-value { color: var(--text-light); font-weight: 500; }

.fxm-signal-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 9999px;
}

.fxm-signal-chip.blue   { background: rgba(59,130,246,0.2); color: var(--accent-blue); }
.fxm-signal-chip.yellow { background: rgba(234,179,8,0.2);  color: var(--accent-amber); }
.fxm-signal-chip.red    { background: rgba(239,68,68,0.2);  color: var(--accent-red); }

.fxm-chat-area {
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 300px;
}

.fxm-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--bg-border);
}

.fxm-chat-header-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-white);
}

.fxm-chat-usage {
  font-size: 12px;
  color: #cbd5e1;
}

.fxm-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 300px;
}

.fxm-chat-messages::-webkit-scrollbar { width: 6px; }
.fxm-chat-messages::-webkit-scrollbar-track { background: transparent; }
.fxm-chat-messages::-webkit-scrollbar-thumb { background: #475569; border-radius: 10px; }

.fxm-msg {
  display: flex;
  gap: 6px;
  max-width: 92%;
}

.fxm-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

/* アバター：スマホでは非表示 */
.fxm-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--bg-border);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

@media (min-width: 480px) {
  .fxm-msg-avatar {
    display: flex;
  }
  .fxm-msg {
    max-width: 85%;
  }
}

.fxm-msg-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}

.fxm-msg.ai .fxm-msg-bubble {
  background: var(--bg-secondary);
  color: var(--text-light);
  border-bottom-left-radius: 4px;
}

.fxm-msg.user .fxm-msg-bubble {
  background: var(--accent-blue);
  color: var(--text-white);
  border-bottom-right-radius: 4px;
}

.fxm-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px 0;
}

.fxm-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingDot 1.2s ease-in-out infinite;
}

.fxm-typing span:nth-child(2) { animation-delay: 0.2s; }
.fxm-typing span:nth-child(3) { animation-delay: 0.4s; }

.fxm-chat-input-area {
  padding: 12px;
  border-top: 1px solid var(--bg-border);
  display: flex;
  gap: 8px;
  align-items: flex-end;
}



.fxm-chat-input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--bg-border);
  color: var(--text-white);
  font-size: 14px;
  font-family: 'Noto Sans JP', sans-serif;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
  max-height: 120px;
}

.fxm-chat-input:focus { border-color: var(--accent-blue); }
.fxm-chat-input::placeholder { color: var(--text-dim); }

.fxm-chat-send {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--accent-blue);
  color: var(--text-white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.fxm-chat-send:hover { opacity: 0.85; }
.fxm-chat-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- アニメーション ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes catchphrasePulse {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(255,222,89,0.5)) drop-shadow(0 0 40px rgba(255,222,89,0.3)); }
  50%       { filter: drop-shadow(0 0 40px rgba(255,222,89,0.9)) drop-shadow(0 0 80px rgba(255,222,89,0.6)); }
}

@keyframes ledPulseBlue {
  0%, 100% {
    background-color: #3b82f6;
    box-shadow: 0 0 10px rgba(59,130,246,0.6), inset 0 0 8px rgba(255,255,255,0.3);
  }
  50% {
    background-color: #60a5fa;
    box-shadow: 0 0 25px rgba(59,130,246,1), 0 0 40px rgba(59,130,246,0.8);
  }
}

@keyframes ledPulseYellow {
  0%, 100% {
    background-color: #eab308;
    box-shadow: 0 0 10px rgba(234,179,8,0.6), inset 0 0 8px rgba(255,255,255,0.3);
  }
  50% {
    background-color: #facc15;
    box-shadow: 0 0 25px rgba(234,179,8,1), 0 0 40px rgba(234,179,8,0.8);
  }
}

@keyframes ledPulseRed {
  0%, 100% {
    background-color: #ef4444;
    box-shadow: 0 0 10px rgba(239,68,68,0.6), inset 0 0 8px rgba(255,255,255,0.3);
  }
  50% {
    background-color: #f87171;
    box-shadow: 0 0 30px rgba(239,68,68,1), 0 0 60px rgba(239,68,68,0.8);
  }
}

/* blue_pre：ON/OFFの速い点滅 */
@keyframes ledBlinkBluePre {
  0%, 49% {
    background-color: var(--led-blue-on);
    box-shadow: 0 0 18px rgba(59,130,246,0.9), 0 0 35px rgba(59,130,246,0.6);
  }
  50%, 100% {
    background-color: #1e3a5f;
    box-shadow: none;
  }
}

@keyframes typingDot {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50%       { transform: scale(1.3); opacity: 1; }
}

@keyframes toastSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ---------- 使い方ボタン ---------- */
.fxm-howto-btn {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--accent-blue);
  color: var(--accent-blue);
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
}
.fxm-howto-btn:hover {
  background: rgba(59,130,246,0.15);
}

/* ---------- 使い方モーダル（幅広） ---------- */
.fxm-modal-wide {
  max-width: 560px;
  width: 95%;
}

/* ---------- 使い方リード文 ---------- */
.fxm-howto-lead {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 16px;
}

/* ---------- フロー統合アコーディオン ---------- */
.fxm-flow-acc {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.fxm-flow-acc-arrow {
  text-align: center;
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.4;
}
.fxm-flow-acc-item {
  border: 1px solid var(--bg-border);
  border-radius: 10px;
  overflow: hidden;
}
.fxm-flow-acc-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border: none;
  cursor: pointer;
  text-align: left;
  gap: 8px;
}
.fxm-flow-acc-header:hover {
  background: rgba(30,41,59,0.9);
}
.fxm-flow-acc-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fxm-flow-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-blue);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fxm-flow-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
}
.fxm-flow-acc-header.open .fxm-flow-num {
  background: #1d4ed8;
}

/* ---------- アコーディオン共通 ---------- */
.fxm-acc-icon {
  font-size: 18px;
  color: var(--accent-blue);
  flex-shrink: 0;
  transition: transform 0.2s;
}
.fxm-flow-acc-header.open .fxm-acc-icon {
  transform: rotate(45deg);
}
.fxm-acc-body {
  display: none;
  padding: 14px 16px;
  background: var(--bg-primary);
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}
.fxm-acc-body p { margin: 0; }
.fxm-acc-box {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-left: 3px solid var(--accent-blue);
  border-radius: 0 8px 8px 0;
  font-size: 13px;
}
.fxm-acc-led-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0;
}
.fxm-acc-led {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
}
.fxm-acc-led.blue   { background: #3b82f6; box-shadow: 0 0 6px #3b82f6; }
.fxm-acc-led.yellow { background: #eab308; box-shadow: 0 0 6px #eab308; }
.fxm-acc-led.red    { background: #ef4444; box-shadow: 0 0 6px #ef4444; }
.fxm-acc-led.blue-pre { background: #3b82f6; animation: ledBlinkBluePre 0.6s step-end infinite; }
/* ---------- LEDカード型説明 ---------- */
.fxm-led-card {
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0;
  border-left: 3px solid;
}
.fxm-led-card.blue      { background: rgba(59,130,246,0.08);  border-color: #3b82f6; }
.fxm-led-card.blue-pre  { background: rgba(59,130,246,0.05);  border-color: #3b82f6; border-style: dashed; }
.fxm-led-card.yellow    { background: rgba(234,179,8,0.08);   border-color: #eab308; }
.fxm-led-card.red       { background: rgba(239,68,68,0.08);   border-color: #ef4444; }
.fxm-led-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.fxm-led-card p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---------- トレード設定パネル ---------- */
.fxm-trade-panel {
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.fxm-trade-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
}
.fxm-trade-panel-note {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}
.fxm-trade-inputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fxm-trade-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.fxm-trade-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fxm-trade-label {
  font-size: 11px;
  color: var(--text-muted);
}
.fxm-trade-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--bg-border);
  border-radius: 8px;
  overflow: hidden;
}
.fxm-trade-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-white);
  font-size: 14px;
  padding: 7px 8px;
  width: 0;
}
.fxm-trade-input::placeholder {
  color: var(--text-muted);
  font-size: 13px;
}
.fxm-trade-input::-webkit-outer-spin-button,
.fxm-trade-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}
.fxm-trade-unit {
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 8px 0 2px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------- 分析開始カード ---------- */
.fxm-analysis-start-card {
  background: var(--bg-secondary);
  border: 1px solid var(--accent-blue);
  border-radius: 12px;
  padding: 16px;
  margin: 8px 0;
  text-align: center;
}
.fxm-analysis-start-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-white);
  margin: 0 0 8px;
}
.fxm-analysis-start-note {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 14px;
}
.fxm-analysis-start-btn {
  background: var(--accent-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}
.fxm-analysis-start-btn:hover {
  opacity: 0.85;
}

/* ============================================================
   ロックバッジ（未ログイン銘柄）
   ============================================================ */
.fxm-card-locked {
  opacity: 0.85;
  cursor: pointer;
}
.fxm-card-locked:hover {
  border-color: #3b82f6;
}
.fxm-card-lock-badge {
  font-size: 10px;
  color: #cbd5e1;
  margin-top: 4px;
  display: block;
}

/* ===== 更新バー ===== */
.fxm-refresh-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 10px;
  padding: 0 4px;
}

.fxm-timestamp {
  font-size: 12px;
  color: #64748b;
}

.fxm-refresh-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid #475569;
  color: #94a3b8;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.fxm-refresh-btn:hover {
  border-color: #3b82f6;
  color: #3b82f6;
}

.fxm-refresh-btn.spinning svg {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ===== アンケートフォーム ===== */
.fxm-survey-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fxm-survey-btn {
  background: transparent;
  border: 1px solid #475569;
  color: #94a3b8;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.fxm-survey-btn:hover {
  border-color: #3b82f6;
  color: #3b82f6;
}

.fxm-survey-btn.selected {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

/* ===== 入力アウトグレーグレーアウト ===== */
.fxm-chat-input-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.fxm-chat-limit-msg {
  text-align: center;
  font-size: 12px;
  color: #64748b;
  padding: 6px 0;
}

/* ===== アカウントボタン ===== */
.fxm-account-btn {
  background: transparent;
  border: 1px solid #475569;
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.fxm-account-btn:hover {
  border-color: #3b82f6;
  color: #3b82f6;
}

/* ===== モバイルキーボード対応 ===== */


/* ===== 小画面対応\uff08320px以下\uff09 ===== */
@media (max-width: 360px) {
  /* トレードパネルコンパクト化 */
  .fxm-trade-panel {
    padding: 8px 10px;
    margin-bottom: 8px;
  }

  /* 分析カードコンパクト化 */
  .fxm-analysis-start-card {
    padding: 10px;
    margin: 4px 0;
  }
  .fxm-analysis-start-title {
    font-size: 13px;
    margin-bottom: 4px;
  }
  .fxm-analysis-start-note {
    font-size: 11px;
    margin-bottom: 10px;
  }
  .fxm-analysis-start-btn {
    padding: 8px 16px;
    font-size: 13px;
  }

  /* ヘッダータイトルのTFタブを非表示 */
  .fxm-tf-panel {
    display: none;
  }

  /* チャットセクションの上下余白削減 */
  .fxm-chat-section {
    padding: 8px;
    gap: 8px;
  }
}

/* ============================================================
   XAUUSD専用スタイル
   ============================================================ */

/* XAUUSDセクションラベル */
.fxm-xauusd-section {
  margin-top: 16px;
}

.fxm-xauusd-label {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  padding-left: 2px;
}


/* XAUUSDカードは fxm-card と同じスタイルを使用（追加スタイルなし） */


/* ============================================================
   XAUUSD チャートパネル
   ============================================================ */

#xauusd-chart-panel {
  background: #ffffff;
  border: 1px solid var(--bg-border);
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.fxm-xauusd-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--bg-border);
}

.fxm-xauusd-chart-title {
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
}

.fxm-xauusd-chart-time {
  font-size: 11px;
  color: var(--text-muted);
}

/* チャートCanvas：PC=350px、スマホ=70vw */
#xauusd-chart-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#xauusd-chart-canvas {
  display: block;
  width: 100%;
  height: 350px;
}

/* チャートパネル：PC時は吹き出し幅に合わせて中央揃え */
@media (min-width: 480px) {
  #xauusd-chart-panel {
    width: 66%;
    margin: 0 auto 8px;
  }
  .fxm-xauusd-chart-header {
    width: 100%;
  }
}

@media (max-width: 767px) {
  #xauusd-chart-canvas {
    height: 70vw;
  }
  #xauusd-chart-panel {
    width: 100%;
  }
}

/* 時間軸切り替えボタン */
.fxm-tf-btns {
  display: flex;
  gap: 4px;
}

.fxm-tf-btn {
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.fxm-tf-btn:hover {
  background: #e2e8f0;
}

.fxm-tf-btn.active {
  background: #1e293b;
  color: #ffffff;
  border-color: #1e293b;
}

/* モード切り替えボタン（デイトレ / スキャル） */
.fxm-mode-btns {
  display: flex;
  gap: 4px;
  margin-right: 6px;
}
.fxm-mode-btn {
  padding: 3px 10px;
  font-size: 11px;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s;
}
.fxm-mode-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}
.fxm-mode-btn.active {
  background: #7c3aed;
  color: #ffffff;
  border-color: #7c3aed;
}
