/* ===== 変数 ===== */
:root {
  --bg: #0f0f1a;
  --bg-card: #1a1a2e;
  --bg-input: #16213e;
  --accent: #6c63ff;
  --accent-light: #8b83ff;
  --accent-glow: rgba(108, 99, 255, 0.3);
  --text: #e8e8f0;
  --text-muted: #8888aa;
  --text-dim: #555577;
  --user-bubble: #2a2a4a;
  --ai-bubble: #1e1e3a;
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --font: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  --header-h: 56px;
  --input-h: 120px;
  --toolbar-h: 48px;
}

/* ===== リセット ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow: hidden;
}

/* ===== ヘッダー ===== */
#app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(15, 15, 26, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(108, 99, 255, 0.15);
  z-index: 100;
}

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

.header-left h1 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.header-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
}

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

.header-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.header-btn:hover { color: var(--text); background: rgba(255,255,255,0.05); }

.session-off { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); }
.session-on { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); }

/* ===== ビュー管理 ===== */
.view { display: none; }
.view.active { display: flex; }

/* ===== スタート画面 ===== */
#view-start {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  align-items: safe center;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 0;
}

.start-content {
  text-align: center;
  padding: 24px;
  max-width: 480px;
}

.start-icon {
  margin-bottom: 24px;
  color: var(--accent);
  opacity: 0.8;
}

.start-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.start-content p {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 32px;
}

.topic-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.topic-input-wrap input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(108, 99, 255, 0.3);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s;
}
.topic-input-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.topic-input-wrap input::placeholder { color: var(--text-dim); }

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary:hover { background: var(--accent-light); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

/* ===== チャット画面 ===== */
#view-chat {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  flex-direction: column;
}

.chat-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 8px;
  scroll-behavior: smooth;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 8px;
}

/* メッセージバブル */
.msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: var(--radius);
  line-height: 1.6;
  font-size: 0.95rem;
  animation: fadeIn 0.3s ease;
}

.msg-user {
  align-self: flex-end;
  background: var(--user-bubble);
  border-bottom-right-radius: 4px;
}

.msg-ai {
  align-self: flex-start;
  background: var(--ai-bubble);
  border: 1px solid rgba(108, 99, 255, 0.1);
  border-bottom-left-radius: 4px;
}

.msg-ai .msg-label {
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.msg-system {
  align-self: center;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
  padding: 8px;
}

/* タイピングインジケータ */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
}
.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.4;
  animation: typing 1.2s ease-in-out infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== ミニマインドマップ ===== */
.mini-mindmap {
  width: 320px;
  border-left: 1px solid rgba(108, 99, 255, 0.15);
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
}
.mini-mindmap.hidden { display: none; }

.mini-mindmap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(108, 99, 255, 0.1);
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}
.icon-btn:hover { color: var(--text); }

.mindmap-container {
  flex: 1;
  min-height: 200px;
}
.mindmap-container.full {
  height: calc(100dvh - var(--header-h) - 48px);
}
.mindmap-container svg { width: 100%; height: 100%; }

/* ===== 入力エリア ===== */
.input-area {
  padding: 8px 16px 4px;
  background: rgba(15, 15, 26, 0.9);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(108, 99, 255, 0.1);
}

.input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-mic {
  position: relative;
  width: 48px;
  height: 48px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.btn-mic:hover { background: var(--accent-glow); }
.btn-mic.recording {
  background: var(--accent);
  color: #fff;
  animation: pulse-ring 1.5s ease-in-out infinite;
}

.mic-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: pulse-expand 1.5s ease-out infinite;
}
.mic-pulse.hidden { display: none; }

@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { box-shadow: 0 0 0 12px transparent; }
}

@keyframes pulse-expand {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.4); opacity: 0; }
}

#text-input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid rgba(108, 99, 255, 0.2);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
  outline: none;
}
#text-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
#text-input::placeholder { color: var(--text-dim); }

.btn-send {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.btn-send:hover { background: var(--accent-light); }
.btn-send:disabled { opacity: 0.4; cursor: not-allowed; }

.input-status {
  display: flex;
  justify-content: space-between;
  padding: 4px 4px 0;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ===== ツールバー ===== */
.toolbar {
  display: flex;
  gap: 4px;
  padding: 6px 16px 8px;
  background: rgba(15, 15, 26, 0.9);
  overflow-x: auto;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border: 1px solid rgba(108, 99, 255, 0.2);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.toolbar-btn:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-glow);
}
.toolbar-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.1);
}

/* ===== マインドマップ全画面 ===== */
#view-mindmap {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  flex-direction: column;
  background: var(--bg);
}

.mindmap-fullscreen {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.mindmap-toolbar {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(108, 99, 255, 0.1);
}

/* ===== 出力画面（TODO/要約） ===== */
#view-output {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  flex-direction: column;
  background: var(--bg);
}

.output-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.output-toolbar {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(108, 99, 255, 0.1);
}

.output-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  line-height: 1.8;
}

.output-content h2 {
  font-size: 1.3rem;
  color: var(--accent-light);
  margin: 24px 0 12px;
}
.output-content h2:first-child { margin-top: 0; }

.output-content h3 {
  font-size: 1.1rem;
  margin: 20px 0 8px;
  color: var(--text);
}

.output-content ul, .output-content ol {
  padding-left: 24px;
}

.output-content li {
  margin: 4px 0;
}

.output-content li input[type="checkbox"] {
  margin-right: 8px;
  accent-color: var(--accent);
}

/* ===== ローディング ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 26, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(108, 99, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===== markmap SVGスタイル上書き ===== */
.mindmap-container .markmap {
  width: 100%;
  height: 100%;
}
.mindmap-container .markmap-node text {
  fill: #e8e8f0 !important;
  font-family: var(--font) !important;
  font-size: 14px !important;
}
.mindmap-container .markmap-node foreignObject div,
.mindmap-container .markmap-node foreignObject span,
.mindmap-container .markmap-foreign div,
.mindmap-container .markmap-foreign span {
  color: #e8e8f0 !important;
}
.mindmap-container .markmap-link {
  stroke: var(--accent) !important;
  stroke-opacity: 0.4 !important;
}

/* ===== セッション情報バー ===== */
.session-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(26, 26, 46, 0.8);
  border-bottom: 1px solid rgba(108, 99, 255, 0.1);
  overflow-x: auto;
  flex-shrink: 0;
}

.info-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(108, 99, 255, 0.1);
  border: 1px solid rgba(108, 99, 255, 0.2);
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.info-chip.active {
  color: var(--accent-light);
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.15);
}

/* ===== サンプルテーマ ===== */
.sample-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}

.sample-topic {
  padding: 8px 16px;
  border: 1px solid rgba(108, 99, 255, 0.25);
  border-radius: 20px;
  background: rgba(108, 99, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
}
.sample-topic:hover {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.15);
  transform: translateY(-1px);
}

/* ===== 使い方ガイド ===== */
.how-it-works {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 32px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: 120px;
}

.step-num {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.step-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

/* ===== 音量メーター ===== */
.volume-meter {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 32px;
  padding: 0 4px;
  flex-shrink: 0;
}

.vol-bar {
  width: 3px;
  background: var(--text-dim);
  border-radius: 2px;
  transition: height 0.05s ease, background 0.15s ease;
  min-height: 3px;
}

.vol-bar.active {
  background: linear-gradient(to top, var(--accent), var(--danger));
}

/* ===== トースト通知 ===== */
#toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #fff;
  animation: toastIn 0.3s ease;
  pointer-events: auto;
}

.toast-success {
  background: rgba(74, 222, 128, 0.9);
  color: #0a2e1a;
}

.toast-error {
  background: rgba(248, 113, 113, 0.9);
}

.toast-warning {
  background: rgba(251, 191, 36, 0.9);
  color: #3a2a00;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== モバイル対応 ===== */
@media (max-width: 768px) {
  .mini-mindmap { display: none !important; }

  .msg { max-width: 92%; }

  .toolbar {
    padding: 6px 8px 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .toolbar::-webkit-scrollbar { display: none; }
  .toolbar-btn { padding: 6px 10px; font-size: 0.75rem; }

  .btn-mic {
    width: 56px;
    height: 56px;
  }

  .how-it-works { gap: 10px; }
  .step { max-width: 100px; }

  .session-info { gap: 6px; padding: 6px 12px; }
  .info-chip { font-size: 0.7rem; padding: 3px 8px; }
}

@media (max-width: 480px) {
  .start-content h2 { font-size: 1.3rem; }
  .start-content p { font-size: 0.9rem; }
  .how-it-works { flex-direction: column; align-items: center; }
  .sample-topics { flex-direction: column; align-items: center; }
}

/* ===== スクロールバー ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(108, 99, 255, 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(108, 99, 255, 0.5); }

/* ===== 認証画面 ===== */
#view-auth, #view-pending {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  align-items: safe center;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 0;
}

.auth-container {
  text-align: center;
  padding: 32px 24px;
  max-width: 400px;
  width: 100%;
}

.auth-container h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 16px 0 8px;
}

.auth-subtitle {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 0.9rem;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border: 1px solid rgba(108, 99, 255, 0.3);
  border-radius: var(--radius);
  overflow: hidden;
}

.auth-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab.active {
  background: var(--accent);
  color: #fff;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(108, 99, 255, 0.3);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s;
}
.auth-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.auth-form input::placeholder { color: var(--text-dim); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-dim);
  font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(108, 99, 255, 0.2);
}

.google-btn-wrap {
  display: flex;
  justify-content: center;
}

.auth-error {
  margin-top: 16px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: rgba(248, 113, 113, 0.15);
  color: var(--danger);
  font-size: 0.85rem;
}

/* 承認待ち */
.pending-icon {
  color: var(--warning);
  margin-bottom: 8px;
}

.pending-message {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 16px;
}

.pending-email {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 24px;
}

.btn-outline {
  padding: 10px 24px;
  border: 1px solid rgba(108, 99, 255, 0.4);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* ===== 管理者パネル ===== */
#view-admin {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  flex-direction: column;
  background: var(--bg);
}

.admin-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid rgba(108, 99, 255, 0.1);
}

.admin-header h2 {
  font-size: 1.2rem;
  font-weight: 600;
}

.admin-user-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(108, 99, 255, 0.1);
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.user-email {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.user-meta {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.user-badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-admin {
  background: rgba(108, 99, 255, 0.2);
  color: var(--accent-light);
}

.badge-approved {
  background: rgba(74, 222, 128, 0.2);
  color: var(--success);
}

.badge-pending {
  background: rgba(251, 191, 36, 0.2);
  color: var(--warning);
}

.user-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-approve {
  padding: 6px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--success);
  color: #0a2e1a;
  font-size: 0.8rem;
  font-family: var(--font);
  cursor: pointer;
  font-weight: 600;
}
.btn-approve:hover { opacity: 0.85; }

.btn-reject {
  padding: 6px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--danger);
  color: #fff;
  font-size: 0.8rem;
  font-family: var(--font);
  cursor: pointer;
  font-weight: 600;
}
.btn-reject:hover { opacity: 0.85; }

@media (max-width: 480px) {
  .user-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .user-actions {
    align-self: flex-end;
  }
}

/* ===== セッション履歴 ===== */
.session-history-section {
  margin-top: 32px;
  text-align: left;
}

.session-history-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-left: 4px;
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid rgba(108, 99, 255, 0.12);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.session-item:hover {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.08);
}

.session-item-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.session-item-topic {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-item-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.session-item-delete {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: all 0.2s;
}
.session-item-delete:hover {
  color: var(--danger);
  background: rgba(248, 113, 113, 0.1);
}

.session-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 16px 0;
}

/* ===== フレームワーク選択 ===== */
.framework-select {
  margin-bottom: 20px;
}

.framework-select-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.framework-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.framework-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 14px;
  border: 1px solid rgba(108, 99, 255, 0.2);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
  min-width: 80px;
}

.framework-option:hover {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.08);
  color: var(--text);
  transform: translateY(-1px);
}

.framework-option.selected {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.15);
  color: var(--accent-light);
  box-shadow: 0 0 12px rgba(108, 99, 255, 0.2);
}

.fw-emoji {
  font-size: 1.3rem;
}

.fw-name {
  font-size: 0.8rem;
  font-weight: 600;
}

.fw-desc {
  font-size: 0.65rem;
  color: var(--text-dim);
}

.framework-option.selected .fw-desc {
  color: var(--text-muted);
}

/* ===== 収束提案ハイライト ===== */
.toolbar-btn.suggest {
  border-color: var(--warning);
  color: var(--warning);
  animation: suggest-pulse 1.5s ease-in-out infinite;
}

@keyframes suggest-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.3); }
  50% { box-shadow: 0 0 8px 2px rgba(251, 191, 36, 0.4); }
}

/* ===== フェーズチップ ===== */
.info-chip.phase-diverge {
  background: rgba(108, 99, 255, 0.15);
  color: var(--accent-light);
  border-color: var(--accent);
}

.info-chip.phase-converge {
  background: rgba(74, 222, 128, 0.15);
  color: var(--success);
  border-color: var(--success);
}

/* ===== セッション一覧 フレームワークタグ ===== */
.session-item-fw {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(108, 99, 255, 0.12);
  color: var(--accent-light);
  margin-left: 6px;
  flex-shrink: 0;
}

/* ===== モバイル: フレームワーク選択 ===== */
@media (max-width: 480px) {
  .framework-options {
    gap: 6px;
  }
  .framework-option {
    padding: 8px 10px;
    min-width: 70px;
  }
  .fw-emoji { font-size: 1.1rem; }
  .fw-name { font-size: 0.7rem; }
  .fw-desc { font-size: 0.6rem; }
}

/* ===== ユーティリティ ===== */
.hidden { display: none !important; }
