/* css/style.css */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f8f7f4;
  --surface:   #ffffff;
  --border:    #e2e0d8;
  --text:      #1a1a18;
  --text-sub:  #6b6b67;
  --primary:   #534AB7;
  --primary-h: #3C3489;
  --danger:    #A32D2D;
  --radius:    12px;
  --shadow:    0 2px 12px rgba(0,0,0,0.06);
}

/* html要素のスクロールを無効化してbody内のスクロール領域のみで管理
   (右側に2本スクロールバーが表示される問題を防止) */
html {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.screen { display: flex; flex-direction: column; height: 100dvh; }
.hidden { display: none !important; }

/* ログイン画面 */
#screen-login {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 40px 32px;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--shadow);
  text-align: center;
}

.logo { font-size: 32px; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.tagline { font-size: 14px; color: var(--text-sub); margin-bottom: 32px; line-height: 1.6; }

.login-buttons { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }

.btn { display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 20px; border-radius: 8px; font-size: 15px; font-weight: 500;
  border: none; cursor: pointer; text-decoration: none; transition: opacity .15s; }
.btn:hover { opacity: .85; }
.btn-primary  { background: var(--primary); color: #fff; }
.btn-secondary{ background: var(--border); color: var(--text); }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-sm       { padding: 8px 14px; font-size: 13px; }

.btn-google { background: #fff; color: #333; border: 1px solid var(--border); }
.btn-line   { background: #06C755; color: #fff; }

.privacy-note { font-size: 12px; color: var(--text-sub); line-height: 1.6; }

/* メイン画面 */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--surface); border-bottom: none;
}
.header-logo { font-weight: 700; font-size: 18px; color: var(--primary); }
.btn-icon {
  background: none;
  border: none;
  padding: 8px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sub);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, transform .25s ease;
}
.btn-icon:hover  { background: var(--bg); color: var(--primary); }
.btn-icon:active { transform: rotate(30deg); }
.btn-icon svg    { display: block; }

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

.message {
  max-width: 80%; padding: 12px 16px; border-radius: var(--radius);
  font-size: 15px; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
}
.message-user {
  align-self: flex-end; background: var(--primary); color: #fff;
  border-bottom-right-radius: 4px;
}
.message-assistant {
  align-self: flex-start; background: var(--surface); border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.action-card {
  align-self: flex-start; background: #EEEDFE; border: 1px solid #AFA9EC;
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px; max-width: 80%;
}

/* タイピングインジケーター（AIが入力中...） */
.typing-indicator {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-bottom-left-radius: 4px;
  padding: 14px 18px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.typing-indicator span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-sub);
  animation: typing-bounce 1.2s ease-in-out infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.18s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.36s; }
@keyframes typing-bounce {
  0%, 70%, 100% { opacity: 0.3; transform: translateY(0); }
  35%           { opacity: 1;   transform: translateY(-4px); }
}
.action-card p { font-size: 14px; color: #3C3489; font-weight: 500; }
.action-card div { display: flex; gap: 8px; }

.chat-input-area {
  display: flex; gap: 8px; padding: 8px 12px;
  background: var(--surface); border-top: 1px solid var(--border);
  align-items: center;
}
#chat-input {
  flex: 1; resize: none;
  border: 1px solid var(--border); border-radius: 20px;
  padding: 8px 14px; font-size: 15px; font-family: inherit;
  line-height: 1.4;
  background: var(--bg); color: var(--text); outline: none;
}
#chat-input:focus { border-color: var(--primary); }

/* 地図カード（現在地等を埋め込み表示） */
.map-card {
  align-self: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin: 4px 0;
  max-width: 100%;
}
.map-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.map-card-close {
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  color: var(--text-sub);
  cursor: pointer;
  padding: 0 4px;
  border-radius: 4px;
}
.map-card-close:hover { color: var(--danger); background: var(--bg); }
.map-card-frame {
  width: 100%;
  height: 220px;
  border: 0;
  display: block;
}
.map-card-coords {
  padding: 6px 12px;
  font-size: 11px;
  color: var(--text-sub);
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.map-card-coords a { color: var(--primary); text-decoration: none; }
.map-card-coords a:hover { text-decoration: underline; }

/* 地図ボタン（正円） — 位置情報ボタンと同じ系統 */
.btn-map {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  background: var(--bg);
  color: var(--text-sub);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
  box-sizing: border-box;
  font-size: 0;
}
.btn-map:hover  { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-map:active { transform: scale(0.92); }
.btn-map svg    { display: block; }

/* 現在地共有トグル（正円アイコン） */
.btn-location {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  background: var(--bg);
  color: var(--text-sub);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
  box-sizing: border-box;
  font-size: 0;
}
.btn-location:hover           { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-location:active          { transform: scale(0.92); }
.btn-location.active          { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-location.active:hover    { background: var(--primary-h); border-color: var(--primary-h); }
.btn-location svg             { display: block; }

/* 送信ボタン（正円アイコン） — IDで指定して .btn の角丸より優先 */
#btn-send,
.btn-send {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s ease, transform .1s ease, opacity .15s ease;
  box-sizing: border-box;
  font-size: 0; /* 余分な行高さの影響を排除 */
}
#btn-send:hover:not(:disabled),
.btn-send:hover:not(:disabled)  { background: var(--primary-h); }
#btn-send:active:not(:disabled),
.btn-send:active:not(:disabled) { transform: scale(0.92); }
#btn-send:disabled,
.btn-send:disabled               { opacity: .45; cursor: not-allowed; }
#btn-send svg,
.btn-send svg                    { display: block; transform: translateX(-1px); /* 紙飛行機の視覚中心調整 */ }

/* ============================================================
   設定モーダル（メイン画面の上に重ねて表示）
   ============================================================ */

/* 背景＋パネル全体のラッパー：fixed で全画面オーバーレイ */
.settings-modal {
  position: fixed; inset: 0;
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  pointer-events: none; /* 開いていない時は透過 */
}
.settings-modal.is-open { pointer-events: auto; }
.settings-modal.hidden  { display: none !important; }

/* 半透明の背景（クリックで閉じる対象） */
.settings-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(20, 18, 30, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .22s ease;
}
.settings-modal.is-open .settings-modal-backdrop { opacity: 1; }

/* 中央のパネル */
.settings-modal-panel {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: transform .22s cubic-bezier(.22,1,.36,1), opacity .18s ease;
}
.settings-modal.is-open .settings-modal-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ヘッダー（タイトル＋×ボタン） */
.settings-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.settings-modal-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.settings-modal-close {
  background: none;
  border: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  color: var(--text-sub);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s ease, color .15s ease;
}
.settings-modal-close:hover { background: var(--bg); color: var(--danger); }

/* スクロール可能なボディ */
.settings-modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px;
  -webkit-overflow-scrolling: touch;
}

/* 保存・戻るボタン横並び */
.setting-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.setting-actions .btn { flex: 1; min-width: 100px; }

/* 設定項目 */
.setting-item { display: flex; flex-direction: column; gap: 8px; }
.setting-item label { font-size: 14px; color: var(--text-sub); font-weight: 500; }
.setting-item select {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 15px; background: var(--bg); color: var(--text);
}
hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

/* モーダル開いている間は背景スクロールを止める */
body.modal-open { overflow: hidden; }

/* スマホ（縦表示）でフルスクリーン寄りに */
@media (max-width: 480px) {
  .settings-modal { padding: 0; align-items: stretch; }
  .settings-modal-panel {
    max-width: 100%; max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    transform: translateY(20px);
  }
  .settings-modal.is-open .settings-modal-panel {
    transform: translateY(0);
  }
}

/* 設定画面の補助テキスト */
.setting-hint {
  font-size: 11px;
  color: var(--text-sub);
  margin-top: 6px;
  line-height: 1.4;
}

/* AI抽出データ表示 */
.insights-block { font-size: 13px; color: var(--text); }
.insight-section { margin-top: 12px; padding-top: 8px; border-top: 1px dashed var(--border); }
.insight-section:first-child { border-top: 0; padding-top: 0; }
.insight-title { font-weight: 600; color: var(--primary); margin-bottom: 4px; }
.insight-text { line-height: 1.6; color: var(--text); }
.insight-sub  { font-size: 12px; color: var(--text-sub); margin-top: 4px; }
.insight-list { list-style: none; padding-left: 0; margin: 4px 0; }
.insight-list li { padding: 4px 0; line-height: 1.5; }
.insight-cat-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 3px 0; }
.insight-cat-label { font-size: 12px; color: var(--text-sub); margin-right: 4px; min-width: 50px; }
.insight-tag {
  display: inline-block; background: #EEEDFE; color: var(--primary-h);
  border-radius: 12px; padding: 2px 10px; font-size: 12px;
}

/* 連携アカウント */
.identities-status { font-size: 13px; color: var(--text); padding: 8px 0; }
.identities-actions { display: flex; flex-direction: column; gap: 8px; }
.link-message { font-size: 12px; color: var(--primary); margin-top: 6px; }

/* ---- ロック画面 ---- */
.lock-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 40px 24px;
  text-align: center;
  background: var(--bg, #f5f5f7);
}
.lock-icon {
  color: var(--primary, #534AB7);
  opacity: 0.85;
  transition: opacity .3s;
  animation: lock-pulse 2.5s ease-in-out infinite;
}
@keyframes lock-pulse {
  0%, 100% { transform: scale(1);    opacity: .85; }
  50%       { transform: scale(1.08); opacity: 1;   }
}

/* ====================================================================
   パーソナ分析パネル（モバイルファースト）
   ==================================================================== */

#btn-persona-toggle.active {
  color: var(--primary);
  opacity: 1;
}

/* パネル本体 */
.persona-panel {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease;
  position: relative; /* 閉じるボタンの絶対配置基準 */
}
.persona-panel.open {
  max-height: 700px;
}

/* persona-panel-inner は HTML のインラインスタイルで管理（CSS依存を排除） */

/* ====================================================================
   クイックリプライ（AIインタビュー選択肢）
   ==================================================================== */
.quick-reply-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px 12px;
  justify-content: flex-start;
}
.quick-reply-btn {
  background: var(--surface);
  border: 1.5px solid var(--primary);
  color: var(--primary);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, color .15s, opacity .15s;
  white-space: nowrap;
}
.quick-reply-btn:hover:not(:disabled) {
  background: var(--primary);
  color: #fff;
}
.quick-reply-btn.selected {
  background: var(--primary);
  color: #fff;
  opacity: 0.7;
}
.quick-reply-btn:disabled:not(.selected) {
  opacity: 0.35;
  cursor: default;
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
  .persona-panel { background: #1c1c1e; }
  .persona-no-data { background: rgba(28,28,30,0.8); color: #aaa; }
  .persona-tag-chip { background: #2c2a4a; color: #a09aed; }
  .persona-tag-chip:hover { background: #3a3760; }
  .quick-reply-btn { background: #1c1c1e; border-color: #a09aed; color: #a09aed; }
  .quick-reply-btn:hover:not(:disabled) { background: #3a3760; color: #fff; }
  .quick-reply-btn.selected { background: var(--primary); color: #fff; }
}

/* ====================================================================
   AIインタビューモーダル
   ==================================================================== */
.interview-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end; /* スマホ：下から出てくる */
  justify-content: center;
  background: rgba(0,0,0,0);
  transition: background .22s ease;
}
.interview-modal.is-open {
  background: rgba(0,0,0,0.45);
}
.interview-modal-inner {
  background: var(--surface);
  width: 100%;
  max-width: 520px;
  max-height: 90dvh;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform .25s cubic-bezier(0.32,0.72,0,1);
}
.interview-modal.is-open .interview-modal-inner {
  transform: translateY(0);
}

/* ヘッダー */
.interview-header {
  display: flex;
  align-items: center;
  padding: 14px 16px 10px;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}
.interview-close-btn {
  flex-shrink: 0;
  color: var(--text-sub);
}
.interview-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}
.interview-progress-text {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-sub);
  min-width: 40px;
  text-align: right;
}

/* プログレスバー */
.interview-progressbar-wrap {
  height: 3px;
  background: var(--border);
}
.interview-progressbar {
  height: 100%;
  background: var(--primary);
  transition: width .3s ease;
}

/* 質問エリア */
.interview-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.interview-axis-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.interview-question {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}
.interview-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 8px;
}
.interview-option-btn {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  transition: background .15s, border-color .15s, transform .1s;
  line-height: 1.4;
}
.interview-option-btn:hover:not(:disabled) {
  background: #EEEDFE;
  border-color: var(--primary);
  color: var(--primary-h);
}
.interview-option-btn.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: scale(0.98);
}
.interview-option-btn:disabled:not(.selected) {
  opacity: 0.4;
  cursor: default;
}

/* 完了画面 */
.interview-complete {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
}
.interview-complete-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.interview-complete-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.interview-complete-sub {
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.7;
}

/* デスクトップ：センター表示 */
@media (min-width: 560px) {
  .interview-modal { align-items: center; }
  .interview-modal-inner {
    border-radius: 20px;
    max-height: 85dvh;
  }
}

/* ダークモード */
@media (prefers-color-scheme: dark) {
  .interview-modal-inner { background: #1c1c1e; }
  .interview-option-btn  { background: #2c2c2e; border-color: #3a3a3c; color: #f0f0f0; }
  .interview-option-btn:hover:not(:disabled) { background: #2c2a4a; border-color: var(--primary); color: #a09aed; }
}

/* ====================================================================
   マッチング機能
   ==================================================================== */

/* ---- ヘッダーのハートボタンバッジ ---- */
#btn-match-open { position: relative; }
.match-header-badge {
  position: absolute;
  top: 0; right: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #e03e3e;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

/* ---- マッチングモーダル（ボトムシート） ---- */
.match-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .25s ease;
}
.match-modal.is-open { opacity: 1; }

.match-modal-inner {
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(40px);
  transition: transform .25s ease;
  box-shadow: 0 -4px 32px rgba(0,0,0,0.12);
}
.match-modal.is-open .match-modal-inner { transform: translateY(0); }

/* ヘッダー */
.match-modal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.match-close-btn { flex-shrink: 0; }
.match-modal-title {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}
.match-tab-switch-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text-sub);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background .15s, color .15s;
}
.match-tab-switch-btn[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 700;
}
.match-tab-switch-btn:hover { background: #EEEDFE; color: var(--primary); }
.match-tab-switch-btn[aria-pressed="true"]:hover { background: var(--primary-h); }

.match-count-badge {
  background: #e03e3e;
  color: #fff;
  border-radius: 8px;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
}

/* ビューエリア */
.match-view {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---- ローディング ---- */
.match-loading {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 40px 0;
}
.match-loading-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.3;
  animation: matchDotPulse 1.2s ease-in-out infinite;
}
.match-loading-dot:nth-child(2) { animation-delay: .2s; }
.match-loading-dot:nth-child(3) { animation-delay: .4s; }
@keyframes matchDotPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
  40%            { opacity: 1;   transform: scale(1.1); }
}

/* ---- ステータスメッセージ ---- */
.match-found-msg {
  font-size: 12px;
  color: var(--text-sub);
  text-align: center;
  padding: 4px 0 2px;
}
.match-empty-msg {
  text-align: center;
  padding: 36px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--text-sub);
  font-size: 14px;
  line-height: 1.7;
}
.match-error-msg {
  color: var(--danger);
  font-size: 13px;
  text-align: center;
  padding: 20px;
}

/* ---- 候補カード ---- */
.match-candidate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: box-shadow .15s;
}
.match-candidate-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,0.09); }

.match-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.match-card-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7B72DA, #534AB7);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-align: center;
}
.match-avatar-sm { width: 36px; height: 36px; font-size: 16px; }

.match-card-info { flex: 1; min-width: 0; }
.match-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.match-card-score {
  font-size: 13px;
  color: var(--text-sub);
  margin-top: 2px;
}
.match-card-reliability {
  font-size: 11px;
  color: #aaa;
  white-space: nowrap;
  flex-shrink: 0;
}

/* タグ列 */
.match-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}
.match-tag-chip {
  background: #EEEDFE;
  color: #3C3489;
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 11px;
  white-space: nowrap;
}
.match-tag-none { font-size: 11px; color: #bbb; }

/* 6軸ミニバー */
.match-bars-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 8px;
}
.match-axis-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.match-axis-label {
  width: 46px;
  font-size: 10px;
  color: var(--text-sub);
  flex-shrink: 0;
  text-align: right;
}
.match-axis-track {
  flex: 1;
  height: 6px;
  background: #e8e6f0;
  border-radius: 3px;
  overflow: hidden;
}
.match-axis-fill {
  height: 100%;
  background: linear-gradient(90deg, #7B72DA, #534AB7);
  border-radius: 3px;
  transition: width .5s ease;
}
.match-axis-val {
  width: 26px;
  font-size: 10px;
  color: #888;
  text-align: right;
  flex-shrink: 0;
}

/* スコア内訳 */
.match-card-breakdown {
  font-size: 10px;
  color: #aaa;
  margin-bottom: 10px;
}

/* アクションボタン */
.match-card-actions {
  display: flex;
  gap: 8px;
}
.btn-match-skip, .btn-match-like {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
  border: none;
}
.btn-match-skip {
  background: #f0eeec;
  color: var(--text-sub);
}
.btn-match-like {
  background: linear-gradient(135deg, #7B72DA, #534AB7);
  color: #fff;
}
.btn-match-skip:hover:not(:disabled)  { background: #e5e3e0; }
.btn-match-like:hover:not(:disabled)  { filter: brightness(1.08); }
.btn-match-skip:active:not(:disabled),
.btn-match-like:active:not(:disabled) { transform: scale(0.97); }
.btn-match-skip:disabled,
.btn-match-like:disabled              { opacity: 0.5; cursor: not-allowed; }

/* アクションオーバーレイ */
.match-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  border-radius: var(--radius);
  animation: overlayFadeIn .2s ease;
}
.overlay-like { background: rgba(83,74,183,0.15); color: var(--primary); }
.overlay-skip { background: rgba(0,0,0,0.08); color: var(--text-sub); }
@keyframes overlayFadeIn { from { opacity:0; } to { opacity:1; } }

/* ---- マッチ済みアイテム ---- */
.match-results-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.match-result-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.match-result-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.match-result-info { flex: 1; min-width: 0; }
.match-result-meta {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 2px;
}
.match-result-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}
.btn-unmatch {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text-sub);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-unmatch:hover { background: #fdecea; color: var(--danger); border-color: var(--danger); }

/* ---- マッチ通知トースト ---- */
.match-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 300;
  background: #fff;
  border: 2px solid var(--primary);
  border-radius: 16px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 24px rgba(83,74,183,0.2);
  min-width: 220px;
  max-width: 320px;
  opacity: 0;
  transition: opacity .35s ease, transform .35s ease;
  cursor: pointer;
}
.match-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.match-toast-icon { font-size: 24px; flex-shrink: 0; }
.match-toast-body { flex: 1; min-width: 0; }
.match-toast-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}
.match-toast-name {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- デスクトップ対応 ---- */
@media (min-width: 560px) {
  .match-modal { justify-content: center; }
  .match-modal-inner {
    border-radius: 20px;
    max-height: 88dvh;
    width: 480px;
    margin: 0 auto;
    transform: scale(0.96) translateY(20px);
  }
  .match-modal.is-open .match-modal-inner { transform: scale(1) translateY(0); }
}

/* ダークモード */
@media (prefers-color-scheme: dark) {
  .match-modal-inner   { background: #1c1c1e; }
  .match-candidate-card,
  .match-result-item   { background: #2c2c2e; border-color: #3a3a3c; }
  .match-tag-chip      { background: #2c2a4a; color: #a09aed; }
  .match-axis-track    { background: #3a3a3c; }
  .btn-match-skip      { background: #3a3a3c; color: #aaa; }
  .match-toast         { background: #1c1c1e; border-color: #7B72DA; }
  .match-tab-switch-btn:hover { background: #2c2a4a; }
}
