/**
 * axia_ux_v2.css — AXIA UX v2 Design System
 * Manus/Genspark級 "成果物が主役" UI
 *
 * Phase 1: 画面構造再設計
 * Phase 2: Header再設計（進捗バー・状態表示）
 * Phase 3: チャットManus風（内部ログ非表示）
 * Phase 4: Workspace Drawer化
 * Phase 5: 成果物カードUI
 * Phase 6: Live Feed改善
 * Phase 7: 完了UI
 * Phase 8: モバイル最適化
 */

/* ═══════════════════════════════════════════════════════════
   Phase 1: 画面構造基盤
   ═══════════════════════════════════════════════════════════ */

/* 内部ログ要素を非表示（デフォルト） */
body:not(.v2-developer-mode) .stream-panel,
body:not(.v2-developer-mode) #streamPanel,
body:not(.v2-developer-mode) .v2-dev-only {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════
   Phase 2: Header 再設計
   ═══════════════════════════════════════════════════════════ */

/* v2 ステータスバー（Headerの直下に追加） */
#v2-status-bar {
  position: sticky;
  top: 0;
  z-index: 300;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  border-bottom: 1px solid rgba(99, 102, 241, 0.3);
  padding: 8px 16px;
  display: none; /* タスク実行中のみ表示 */
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

#v2-status-bar.v2-active {
  display: flex;
}

.v2-status-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.v2-status-main {
  flex: 1;
  min-width: 0;
}

.v2-status-task {
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
}

.v2-status-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.v2-status-sub-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 進捗バー */
.v2-progress-wrap {
  flex: 0 0 160px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.v2-progress-bar {
  height: 4px;
  background: rgba(99, 102, 241, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.v2-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 2px;
  transition: width 0.5s ease;
  width: 0%;
}

.v2-progress-label {
  font-size: 10px;
  color: #64748b;
  text-align: right;
}

/* 成果数バッジ */
.v2-artifact-count {
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 11px;
  color: #818cf8;
  white-space: nowrap;
}

/* 実行時間 */
.v2-elapsed {
  font-size: 11px;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   Phase 3: チャット Manus風（内部ログ非表示）
   ═══════════════════════════════════════════════════════════ */

/* 内部ログメッセージを非表示 */
body:not(.v2-developer-mode) .v2-internal-log {
  display: none !important;
}

/* AIメッセージの内部スコア表示を非表示 */
body:not(.v2-developer-mode) .v2-score-badge,
body:not(.v2-developer-mode) .v2-raw-log {
  display: none !important;
}

/* 長文AIメッセージの折りたたみ */
.v2-msg-collapsible {
  position: relative;
}

.v2-msg-body {
  max-height: 200px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.v2-msg-body.v2-expanded {
  max-height: 9999px;
}

.v2-msg-fade {
  position: absolute;
  bottom: 28px;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(transparent, #1e1e2e);
  pointer-events: none;
}

.v2-msg-body.v2-expanded + .v2-msg-fade {
  display: none;
}

.v2-msg-toggle {
  display: block;
  width: 100%;
  padding: 4px 0;
  background: none;
  border: none;
  color: #60a5fa;
  font-size: 12px;
  cursor: pointer;
  text-align: center;
  margin-top: 4px;
}

.v2-msg-toggle:hover {
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════
   Phase 4: Workspace Drawer
   ═══════════════════════════════════════════════════════════ */

/* Workspace Drawer オーバーレイ */
#v2-workspace-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#v2-workspace-overlay.v2-open {
  opacity: 1;
  pointer-events: auto;
}

/* Workspace Drawer 本体 */
#v2-workspace-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 90vw;
  background: #0f172a;
  border-left: 1px solid rgba(99, 102, 241, 0.3);
  z-index: 901;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#v2-workspace-drawer.v2-open {
  transform: translateX(0);
}

/* Drawer ヘッダー */
.v2-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  flex-shrink: 0;
}

.v2-drawer-title {
  font-size: 15px;
  font-weight: 700;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.v2-drawer-close {
  background: none;
  border: none;
  color: #64748b;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s;
}

.v2-drawer-close:hover {
  color: #e2e8f0;
}

/* Drawer タブ */
.v2-drawer-tabs {
  display: flex;
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  flex-shrink: 0;
}

.v2-drawer-tab {
  flex: 1;
  padding: 10px 8px;
  background: none;
  border: none;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.v2-drawer-tab.v2-active {
  color: #818cf8;
  border-bottom-color: #818cf8;
}

.v2-drawer-tab:hover:not(.v2-active) {
  color: #94a3b8;
}

/* 開発者モード以外は開発ログタブを非表示 */
body:not(.v2-developer-mode) .v2-drawer-tab[data-tab="devlog"] {
  display: none;
}

/* Drawer コンテンツ */
.v2-drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.v2-drawer-pane {
  display: none;
}

.v2-drawer-pane.v2-active {
  display: block;
}

/* Drawer 内の成果物リスト */
.v2-drawer-artifacts {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 進行中タスクリスト */
.v2-drawer-running {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.v2-running-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 8px;
  font-size: 12px;
  color: #94a3b8;
}

.v2-running-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6366f1;
  animation: v2Pulse 1.5s infinite;
  flex-shrink: 0;
}

@keyframes v2Pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* 開発ログ */
.v2-devlog {
  font-family: monospace;
  font-size: 11px;
  color: #64748b;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Workspace 開くボタン（右下固定） */
#v2-workspace-open-btn {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 800;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  transition: all 0.2s;
}

#v2-workspace-open-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
}

#v2-workspace-open-btn .v2-ws-badge {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 1px 6px;
  font-size: 11px;
}

/* ═══════════════════════════════════════════════════════════
   Phase 5: 成果物カードUI
   ═══════════════════════════════════════════════════════════ */

/* 成果物カード */
.v2-artifact-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s;
}

.v2-artifact-card:hover {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
  transform: translateY(-1px);
}

/* サムネエリア */
.v2-artifact-thumb {
  width: 100%;
  height: 120px;
  background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  position: relative;
  overflow: hidden;
}

.v2-artifact-thumb iframe {
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none;
  transform: scale(0.5);
  transform-origin: top left;
  width: 200%;
  height: 200%;
}

.v2-artifact-thumb-icon {
  font-size: 40px;
  opacity: 0.6;
}

/* カード情報エリア */
.v2-artifact-info {
  padding: 12px 14px;
}

.v2-artifact-name {
  font-size: 14px;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-artifact-desc {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 10px;
  line-height: 1.4;
}

.v2-artifact-actions {
  display: flex;
  gap: 8px;
}

.v2-artifact-btn {
  flex: 1;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s;
}

.v2-artifact-btn-preview {
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #818cf8;
}

.v2-artifact-btn-preview:hover {
  background: rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
}

.v2-artifact-btn-dl {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

.v2-artifact-btn-dl:hover {
  background: rgba(34, 197, 94, 0.25);
}

/* ═══════════════════════════════════════════════════════════
   Phase 6: Live Feed 改善（簡易/詳細切り替え）
   ═══════════════════════════════════════════════════════════ */

/* v2 Live Feed パネル */
#v2-live-feed {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 850;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  overflow: hidden;
  transition: all 0.3s ease;
  display: none;
}

#v2-live-feed.v2-visible {
  display: block;
}

#v2-live-feed.v2-minimized {
  width: 200px;
}

/* Live Feed ヘッダー */
.v2-feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  cursor: move;
  user-select: none;
}

.v2-feed-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
}

.v2-feed-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: v2Pulse 1.5s infinite;
}

.v2-feed-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.v2-feed-ctrl-btn {
  background: none;
  border: none;
  color: #475569;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  transition: color 0.2s;
}

.v2-feed-ctrl-btn:hover {
  color: #94a3b8;
}

/* 簡易表示 */
.v2-feed-simple {
  padding: 8px 12px;
  font-size: 12px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 詳細表示 */
.v2-feed-detail {
  max-height: 160px;
  overflow-y: auto;
  padding: 8px 12px;
  display: none;
}

#v2-live-feed.v2-detail-mode .v2-feed-simple {
  display: none;
}

#v2-live-feed.v2-detail-mode .v2-feed-detail {
  display: block;
}

#v2-live-feed.v2-minimized .v2-feed-simple,
#v2-live-feed.v2-minimized .v2-feed-detail {
  display: none;
}

.v2-feed-log-item {
  font-size: 11px;
  color: #64748b;
  padding: 2px 0;
  border-bottom: 1px solid rgba(99, 102, 241, 0.08);
  font-family: monospace;
  line-height: 1.5;
}

.v2-feed-log-item:last-child {
  border-bottom: none;
  color: #94a3b8;
}

/* ═══════════════════════════════════════════════════════════
   Phase 7: 完了UI
   ═══════════════════════════════════════════════════════════ */

/* v2 完了カード */
.v2-done-card {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.08) 0%, rgba(99, 102, 241, 0.08) 100%);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 16px;
  padding: 20px;
  margin: 12px 0;
}

.v2-done-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.v2-done-icon {
  font-size: 24px;
}

.v2-done-title {
  font-size: 16px;
  font-weight: 700;
  color: #4ade80;
}

.v2-done-subtitle {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

/* 完成物セクション */
.v2-done-section {
  margin-bottom: 14px;
}

.v2-done-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

/* 次のアクション */
.v2-done-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.v2-done-action-btn {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
}

.v2-done-action-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
}

.v2-done-action-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.v2-done-action-secondary {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #818cf8;
}

.v2-done-action-secondary:hover {
  background: rgba(99, 102, 241, 0.25);
}

/* 詳細セクション（折りたたみ） */
.v2-done-detail-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #475569;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 0;
  margin-top: 8px;
}

.v2-done-detail-toggle:hover {
  color: #64748b;
}

.v2-done-detail-content {
  display: none;
  margin-top: 8px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 8px;
  font-size: 11px;
  color: #64748b;
  font-family: monospace;
}

.v2-done-detail-content.v2-open {
  display: block;
}

/* ═══════════════════════════════════════════════════════════
   Phase 8: モバイル最適化
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  /* Workspace Drawer をフルスクリーンに */
  #v2-workspace-drawer {
    width: 100%;
    max-width: 100%;
  }

  /* Live Feed をコンパクトに */
  #v2-live-feed {
    bottom: 70px;
    right: 12px;
    left: 12px;
    width: auto;
  }

  /* Workspace ボタンをモバイルナビに統合 */
  #v2-workspace-open-btn {
    bottom: 70px;
    right: 12px;
  }

  /* 成果物カードをフルWidth */
  .v2-artifact-card {
    width: 100%;
  }

  /* 完了カードのアクションを縦積み */
  .v2-done-actions {
    flex-direction: column;
  }

  .v2-done-action-btn {
    width: 100%;
    justify-content: center;
  }

  /* ステータスバーをコンパクトに */
  #v2-status-bar {
    padding: 6px 12px;
  }

  .v2-status-task {
    font-size: 12px;
    max-width: 200px;
  }

  .v2-progress-wrap {
    flex: 0 0 100px;
  }

  /* タップしやすいボタンサイズ */
  .v2-artifact-btn {
    min-height: 40px;
    font-size: 13px;
  }

  .v2-done-action-btn {
    min-height: 44px;
    font-size: 13px;
  }
}

/* ═══════════════════════════════════════════════════════════
   Developer Mode
   ═══════════════════════════════════════════════════════════ */

.v2-dev-mode-badge {
  position: fixed;
  top: 60px;
  right: 12px;
  z-index: 9999;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  pointer-events: none;
}

/* Developer Mode トグルボタン */
#v2-dev-toggle {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 800;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 8px;
  padding: 6px 10px;
  color: #475569;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

#v2-dev-toggle:hover {
  color: #94a3b8;
  border-color: rgba(99, 102, 241, 0.5);
}

/* ═══════════════════════════════════════════════════════════
   Scrollbar スタイル
   ═══════════════════════════════════════════════════════════ */

.v2-drawer-content::-webkit-scrollbar,
.v2-feed-detail::-webkit-scrollbar {
  width: 4px;
}

.v2-drawer-content::-webkit-scrollbar-track,
.v2-feed-detail::-webkit-scrollbar-track {
  background: transparent;
}

.v2-drawer-content::-webkit-scrollbar-thumb,
.v2-feed-detail::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: 2px;
}

/* ═══════════════════════════════════════════════════════════
   既存UIの上書き修正
   ═══════════════════════════════════════════════════════════ */

/* 既存の Workspace パネルを非表示（Drawer に置き換え） */
#workspacePanel {
  display: none !important;
}

/* 既存の uwOpenBtn を非表示（v2ボタンに置き換え） */
#uwOpenBtn {
  display: none !important;
}

/* Live Computer Surface を非表示（通常ユーザー向け） */
body:not(.v2-developer-mode) #liveComputerSurface {
  display: none !important;
}

/* axia-live-bar の内部ログ要素を非表示 */
body:not(.v2-developer-mode) .alb-next {
  display: none;
}

/* チャット内の score=X.X/10 表示を非表示 */
body:not(.v2-developer-mode) .v2-score-text {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════
   UX v2 Phase 9: Workspace常時表示・3カラムレイアウト修正
   ═══════════════════════════════════════════════════════════ */

/* chat-layout: flexからgridへ変更して3カラムを実現 */
.chat-layout,
.chat-layout.lc-open,
.chat-layout.focus-mode {
  display: grid !important;
  grid-template-columns: 260px minmax(400px, 1fr) 400px !important;
  grid-template-rows: 1fr !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

/* thread-sidebar を grid の1列目に固定 */
.chat-layout .thread-sidebar,
.chat-layout.lc-open .thread-sidebar,
.chat-layout.focus-mode .thread-sidebar {
  grid-column: 1 !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  display: flex !important;
}

/* center-chat を grid の2列目に固定 */
.chat-layout .center-chat,
.chat-layout.lc-open .center-chat,
.chat-layout.focus-mode .center-chat {
  grid-column: 2 !important;
  min-width: 0 !important;
  max-width: none !important;
  flex: unset !important;
}

/* unified-workspace-panel を grid の3列目に固定・常時表示 */
.chat-layout .unified-workspace-panel,
.chat-layout.lc-open .unified-workspace-panel,
.chat-layout.focus-mode .unified-workspace-panel {
  grid-column: 3 !important;
  display: flex !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
}

/* focus-mode でも Workspace を表示 */
.chat-layout.focus-mode .unified-workspace-panel {
  display: flex !important;
}

/* Unified Workspace Panel を常時表示 */
#unifiedWorkspacePanel {
  display: flex !important;
}

/* Workspace リサイズハンドル */
.uw-resize-handle {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  z-index: 10;
  background: transparent;
  transition: background 0.2s;
}
.uw-resize-handle:hover,
.uw-resize-handle.dragging {
  background: rgba(99, 102, 241, 0.4);
}

/* live-computer-panel は非表示（UX v2では不使用） */
body:not(.v2-developer-mode) .live-computer-panel,
body:not(.v2-developer-mode) #liveComputerPanel {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════
   UX v2 Phase 10: チャット中央エリア改善（長文折りたたみ）
   ═══════════════════════════════════════════════════════════ */

/* ユーザーメッセージの長文折りたたみ */
.message-row.user .message-content,
.message-row.user .msg-text {
  max-height: 120px;
  overflow: hidden;
  position: relative;
  transition: max-height 0.3s ease;
}
.message-row.user .message-content.v2-expanded,
.message-row.user .msg-text.v2-expanded {
  max-height: none;
}
/* 折りたたみフェードグラデーション */
.message-row.user .message-content:not(.v2-expanded)::after,
.message-row.user .msg-text:not(.v2-expanded)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(transparent, var(--surface-user, #1e293b));
  pointer-events: none;
}
/* 「もっと見る」ボタン */
.v2-msg-expand-btn {
  display: block;
  width: 100%;
  text-align: center;
  background: none;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 6px;
  color: #6366f1;
  font-size: 12px;
  padding: 4px 12px;
  cursor: pointer;
  margin-top: 4px;
  transition: all 0.2s;
}
.v2-msg-expand-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.5);
}

/* ═══════════════════════════════════════════════════════════
   UX v2 Phase 11: モバイル対応（3カラム → 1カラム）
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  .chat-layout,
  .chat-layout.lc-open,
  .chat-layout.focus-mode {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
  }
  .chat-layout .thread-sidebar,
  .chat-layout.lc-open .thread-sidebar,
  .chat-layout.focus-mode .thread-sidebar {
    display: none !important;
  }
  #unifiedWorkspacePanel {
    display: none !important;
  }
}

/* タブレット（768px〜1023px）: サイドバー非表示、Workspace表示 */
@media (min-width: 768px) and (max-width: 1023px) {
  .chat-layout,
  .chat-layout.lc-open,
  .chat-layout.focus-mode {
    grid-template-columns: 0 minmax(300px, 1fr) 320px !important;
  }
  .chat-layout .thread-sidebar,
  .chat-layout.lc-open .thread-sidebar,
  .chat-layout.focus-mode .thread-sidebar {
    display: none !important;
  }
  #unifiedWorkspacePanel {
    width: 320px !important;
    min-width: 280px !important;
  }
}
