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

:root {
  --background-color: #1e1e1e;
  --header-background: linear-gradient(135deg, #1e1e1e 0%, #2d2d2d 100%);
  --accent-color: #667eea;
  --container-border-color: #667eea;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: var(--header-background);
  color: #e0e0e0;
  height: 100vh;
  overflow: hidden;
}

.container {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0 20px 20px 20px; /* 上部の余白を削除してヘッダーのドラッグ範囲を拡大 */
  height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  height: 40px;
  padding: 0 20px 0 80px; /* 左側80pxでmacOS信号機ボタンの領域を確保 */
  border-bottom: 2px solid #3a3a3a;
  -webkit-app-region: drag; /* ウィンドウドラッグを有効化 */
  cursor: move;
  position: relative;
  z-index: 1100; /* 集中モードオーバーレイよりも上に表示 */
  background: linear-gradient(135deg, #1e1e1e 0%, #2d2d2d 100%); /* 背景を追加 */
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  width: 100%;
  height: 100%;
}

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

.avatar-large {
  font-size: 2.2em;
  width: 60px;
  height: 60px;
  aspect-ratio: 1 / 1; /* 縦横比を1:1に固定 */
  line-height: 60px; /* 高さに合わせて中央配置 */
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  overflow: hidden; /* はみ出し防止 */
  flex-shrink: 0; /* サイズ固定 */
}

.avatar-large .app-icon {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 画像を円形にフィットさせる */
  border-radius: 50%;
}

.header-text {
  -webkit-app-region: no-drag; /* テキスト選択を可能にする */
  user-select: text; /* テキスト選択を明示的に許可 */
}

.header-text h1 {
  font-size: 1.2em;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  line-height: 40px;
}

.subtitle {
  color: #999;
  font-size: 0.95em;
  margin: 0; /* デフォルトマージンをリセット */
}

.subtitle-inline {
  color: #999;
  font-size: 0.8em;
  font-weight: 400;
  background: none;
  -webkit-text-fill-color: #999;
}

.avatar-small {
  font-size: 1.2em;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-small .app-icon-small {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ウィジェットグリッド */
.widget-grid {
  --widget-cell-size: 120px;
  display: grid;
  grid-template-columns: repeat(auto-fit, var(--widget-cell-size));
  grid-auto-rows: var(--widget-cell-size);
  gap: 16px;
  padding: 15px;
  flex: 0 0 38.2%; /* 黄金比: 固定サイズ */
  min-height: 0;
  border-bottom: 2px solid #3a3a3a;
  overflow-y: auto;
  -webkit-app-region: no-drag;
}

.widget-tile {
  width: 100%;
  height: 100%;
  background: #2a2a2a;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
  box-sizing: border-box;
}

.widget-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* 時計ウィジェット（キャプションなし・中央配置） */
.clock-widget {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px;
  overflow: hidden;
  min-height: 0;
}

.widget-clock-svg {
  width: 100%;
  height: auto;
  max-height: 82px;
  min-height: 0;
  flex: 0 1 auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.widget-header {
  color: #999;
  font-size: 0.7em;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

/* デジタル時計ウィジェット */
.digital-clock-widget {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0;
}

/* 時刻と稼働状態の間の余計なアイコン・擬似要素を出さない */
.digital-clock-widget .digital-time::before,
.digital-clock-widget .digital-time::after,
.digital-clock-widget .resource-status::before,
.digital-clock-widget .resource-status::after {
  content: none !important;
  display: none !important;
}

/* 7セグ風デジタル表示（Share Tech Mono） */
.digital-time {
  color: #b0e0a8;
  font-weight: 400;
  font-size: 1.35em;
  font-family: 'Share Tech Mono', 'Courier New', Consolas, monospace;
  text-align: center;
  letter-spacing: 0.05em;
}

.resource-status {
  color: #999;
  font-size: 0.75em;
  text-align: center;
  margin-top: 8px;
}

.resource-status.working {
  color: #4CAF50;
}

.resource-status.break {
  color: #FF9800;
}

/* アナログ時計ウィジェット内の昼/夜枠表示（時計とセット） */
.clock-widget {
  flex-direction: column;
  gap: 4px;
}

.clock-widget .clock-period-legend {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 0.6em;
  padding: 2px 0 0;
  flex-shrink: 0;
  font-size: 0.7em;
}

.clock-widget .clock-period-legend .period-item {
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  display: none;
}

.clock-widget .clock-period-legend .period-item.period-visible {
  display: inline;
}

.clock-widget .clock-period-legend .period-day {
  color: #e0c060;
}

.clock-widget .clock-period-legend .period-night {
  color: #90a0c0;
}

.resource-status.over-capacity {
  color: #f44336;
  font-weight: 600;
}

/* 統計ウィジェット */
.stat-widget {
  justify-content: center;
  gap: 8px;
}

.widget-label {
  color: #999;
  font-size: 0.65em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.widget-value {
  color: #fff;
  font-size: 1.1em;
  font-weight: 600;
  font-family: 'Courier New', 'Consolas', monospace;
  text-align: center;
  white-space: nowrap;
}

.widget-value.warning {
  color: #FF9800;
}

.widget-value.danger {
  color: #f44336;
}

.widget-value.success {
  color: #4CAF50;
}

/* KPIウィジェット（1KPI=1ウィジェット） */
.kpi-widget.kpi-widget-single {
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}
.kpi-widget-title {
  font-size: 0.68em;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.25;
  word-break: break-word;
  overflow-wrap: break-word;
}
.kpi-widget-value-line {
  font-size: 0.95em;
  color: #fff;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
  line-height: 1.3;
  word-break: break-word;
}
.kpi-widget-target-line,
.kpi-widget-diff-line {
  font-size: 0.6em;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}
.kpi-widget-target-line {
  color: #aaa;
}
.kpi-widget-diff-line {
  font-weight: 600;
}
.kpi-widget-diff-line.kpi-signal-green {
  color: #4CAF50;
}
.kpi-widget-diff-line.kpi-signal-red {
  color: #f44336;
}
.kpi-widget-last-updated {
  font-size: 0.55em;
  color: #666;
  margin-top: 2px;
  line-height: 1.3;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

/* 今日の進捗（プログレスサークルで文字を囲む） */
.today-progress-widget {
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.today-progress-wrap.today-progress-circle-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 88px;
}

.today-progress-ring {
  position: absolute;
  width: 80px;
  height: 80px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.today-progress-ring-svg {
  width: 100%;
  height: 100%;
}

.today-progress-ring-bg {
  fill: none;
  stroke: #333;
  stroke-width: 3;
}

.today-progress-ring-fill {
  fill: none;
  stroke: #4CAF50;
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray 0.3s ease;
}

.today-progress-text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.7em;
  text-align: center;
  line-height: 1.25;
  word-break: break-all;
  padding: 0 4px;
}

.today-progress-text .widget-value {
  font-size: 1.1em;
  font-weight: 600;
}

/* 消化予定（改行で枠に収める） */
.digestion-widget .digestion-content {
  font-size: 0.9em;
  line-height: 1.35;
  word-break: break-word;
  white-space: pre-line;
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 感情ウィジェット（棒グラフ＋支配的感情、枠内に収める） */
.emotion-widget {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 2px;
  min-height: 0;
  overflow: hidden;
}

.emotion-dominant {
  flex-shrink: 0;
  font-size: 1em;
  line-height: 1.1;
  text-align: center;
  min-height: 1.1em;
}

.emotion-bars {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  gap: 0;
  width: 100%;
  overflow: hidden;
}

.emotion-bar-row {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 0.58em;
  line-height: 1;
  flex-shrink: 0;
  min-height: 0;
}

.emotion-bar-emoji {
  flex-shrink: 0;
  width: 1.1em;
  text-align: center;
}

.emotion-bar-track {
  flex: 1;
  min-width: 0;
  height: 4px;
  background: #333;
  border-radius: 1px;
  overflow: hidden;
}

.emotion-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 2px;
  transition: width 0.2s ease;
}

.emotion-bar-count {
  flex-shrink: 0;
  color: #999;
  font-variant-numeric: tabular-nums;
}

/* アクションウィジェット（更新ボタン）- 削除済み（タスクリストヘッダーに統合） */

main.main-content {
  position: relative; /* ポモドーロ集中モードの配置基準 */
  flex: 1;
  display: flex;
  flex-direction: row;
  gap: 0;
  overflow: hidden;
  padding: 0;
}

/* 左パネル: 情報表示とタスク一覧 */
.left-panel {
  width: 38.2%; /* 黄金比 */
  display: flex;
  flex-direction: column;
  border-right: 2px solid #3a3a3a;
  overflow: hidden;
}

/* ウィジェットグリッドエリア（上記で定義済み） */

/* ウィジェットグリッドのスクロールバー */
.widget-grid::-webkit-scrollbar {
  width: 8px;
}

.widget-grid::-webkit-scrollbar-track {
  background: #1e1e1e;
  border-radius: 4px;
}

.widget-grid::-webkit-scrollbar-thumb {
  background: #4a4a4a;
  border-radius: 4px;
}

.widget-grid::-webkit-scrollbar-thumb:hover {
  background: #5a5a5a;
}

/* タスク一覧コンテナ */
.task-list-container {
  flex: 1 1 0; /* 残り領域を全て使う */
  min-height: 0;
  overflow-y: auto;
  padding: 15px;
}

/* タスクリストヘッダー */
.task-list-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
  padding: 12px;
  background: #2a2a2a;
  border-radius: 8px;
  -webkit-app-region: no-drag;
}

.task-refresh-btn-compact {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.2em;
  cursor: pointer;
  transition: all 0.3s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-app-region: no-drag;
}

.task-refresh-btn-compact:hover {
  transform: rotate(180deg) scale(1.1);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.task-refresh-btn-compact:active {
  transform: rotate(180deg) scale(0.95);
}

/* タグフィルターセクション */
.tag-filter-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#tagFilterInput {
  width: 100%;
  background: #1e1e1e;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  padding: 8px 12px;
  color: #fff;
  font-size: 0.85em;
  transition: border-color 0.2s;
}

#tagFilterInput:focus {
  outline: none;
  border-color: #4CAF50;
}

#tagFilterInput::placeholder {
  color: #666;
}

.tag-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 20px;
}

.tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 0.75em;
  padding: 4px 8px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tag-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.tag-badge-remove {
  font-size: 1.1em;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}

.tag-badge-remove:hover {
  opacity: 1;
}

/* タスク一覧コンテナのスクロールバー（ダークテーマ） */
.task-list-container::-webkit-scrollbar {
  width: 8px;
}

.task-list-container::-webkit-scrollbar-track {
  background: #1e1e1e;
  border-radius: 4px;
}

.task-list-container::-webkit-scrollbar-thumb {
  background: #4a4a4a;
  border-radius: 4px;
}

.task-list-container::-webkit-scrollbar-thumb:hover {
  background: #5a5a5a;
}

/* 右パネル: チャットエリア */
.right-panel {
  width: 61.8%; /* 黄金比 */
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  padding-left: 20px; /* リサイズバーとの間隔を確保 */
}

/* パネル間のリサイザー */
.panel-resizer {
  width: 4px;
  background: #2a2a2a; /* ダークテーマに合わせて暗めに */
  cursor: col-resize;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  transition: background 0.2s;
}

.panel-resizer:hover {
  background: #4a4a4a; /* ホバー時は少し明るく */
}

.panel-resizer:active {
  background: #667eea; /* ドラッグ中はアクセントカラー */
}

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative; /* ヘルプボタンの配置基準 */
  width: 100%;
  height: 100%;
}

.running-task-panel {
  background: linear-gradient(135deg, #1e3a2e 0%, #2a4a3a 100%);
  border: 2px solid #52c41a;
  border-radius: 12px;
  padding: 20px;
  margin: 20px;
  animation: slideDown 0.3s ease;
}

/* ポモドーロ集中モード */
.running-task-panel.focus-mode {
  position: fixed;
  top: 30px;
  left: 30px;
  right: 30px;
  bottom: 30px;
  width: auto;
  height: auto;
  max-width: none;
  display: flex;
  flex-direction: column;
  margin: 0;
  border-radius: 20px;
  background: rgba(10, 31, 21, 0.98); /* やや不透明度を上げて集中感を強化 */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid rgba(82, 196, 26, 0.5);
  padding: clamp(30px, 3vw, 50px);
  z-index: 1200;  /* ヘッダ（1100）より上に表示 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: focusIn 0.5s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  overflow-y: auto;  /* コンテンツが多い場合スクロール可能 */
}

.running-task-panel .running-task-content {
  position: relative;
}

/* モード切替ボタン（ヘッダー内に表示） */
.pomodoro-mode-toggle-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.pomodoro-mode-toggle-btn:hover {
  background: rgba(82, 196, 26, 0.2);
  border-color: rgba(82, 196, 26, 0.5);
}

/* タスク本文＋編集アイコン（集中・ミニ共通） */
.task-content-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 12px;
}

.task-content-row .task-content-text {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.task-edit-icon-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.task-edit-icon-btn:hover {
  background: rgba(82, 196, 26, 0.15);
  border-color: rgba(82, 196, 26, 0.4);
}

/* Obsidianで開く（絵文字📖・編集の右に表示・ホバーでファイル名） */
.obsidian-icon-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.obsidian-icon-btn:hover {
  background: rgba(82, 196, 26, 0.15);
  border-color: rgba(82, 196, 26, 0.4);
}

/* ポモドーロミニモード（横幅いっぱい・横長で表示、感情ボタンが改行しない） */
.running-task-panel.mini-mode {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 12px 0 0 0;
  padding: 12px;
  border-radius: 12px;
  background: rgba(10, 31, 21, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid rgba(82, 196, 26, 0.5);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.mini-mode-inner {
  position: relative;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}

.running-task-panel.mini-mode {
  overflow: visible;
}

/* ミニモード用コメント入力（ペンディング/完了時に getTaskComment() で取得） */
.mini-comment-input {
  width: 100%;
  padding: 6px 10px;
  font-size: 0.8rem;
  background: rgba(42, 42, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #e0e0e0;
  outline: none;
}

.mini-comment-input::placeholder {
  color: #888;
}

.mini-timer-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mini-mode-inner .mini-mode-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.running-task-panel.mini-mode .mini-timer-arc {
  width: 140px;
  height: 140px;
}

.running-task-panel.mini-mode .timer-arc-progress {
  transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}

.running-task-panel.mini-mode .timer-arc-progress.timer-warning { stroke: #faad14; }
.running-task-panel.mini-mode .timer-arc-progress.timer-danger { stroke: #f5222d; }

/* ミニモード：プログレスサークル内の文字を円に内接する割合に */
.running-task-panel.mini-mode .timer-text {
  font-size: 28px;
  font-weight: 600;
  fill: #52c41a;
  font-variant-numeric: tabular-nums;
}

.running-task-panel.mini-mode #timerDisplay.timer-warning { fill: #faad14; }
.running-task-panel.mini-mode #timerDisplay.timer-danger { fill: #f5222d; }

.mini-task-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.mini-task-title {
  flex: 1;
  min-width: 0;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.95);
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ミニモード：保留・完了を集中モードと同様に横並び・小さめサイズ */
.running-task-panel.mini-mode .task-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
}

.running-task-panel.mini-mode .task-actions .complete-with-emotion-btn,
.running-task-panel.mini-mode .task-actions .pending-with-emotion-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #2a2a2a;
  border: 2px solid #4a4a4a;
  border-radius: 10px;
  cursor: pointer;
  flex-wrap: nowrap;
  justify-content: flex-start;
}

.running-task-panel.mini-mode .task-actions .pending-label {
  font-size: 0.8rem;
  color: #667eea;
  font-weight: 600;
}

.running-task-panel.mini-mode .task-actions .complete-label {
  font-size: 0.8rem;
  color: #52c41a;
  font-weight: 600;
}

.running-task-panel.mini-mode .task-actions .emotion-icon-btn {
  width: 36px;
  height: 36px;
  font-size: 1.35em;
  background: transparent;
  border: 2px solid #3a3a3a;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.running-task-panel.mini-mode .task-actions .emotion-icon-btn:hover:not(:disabled) {
  transform: scale(1.08);
}

.running-task-panel.mini-mode .task-actions .emotion-icon-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.running-task-panel.mini-mode .task-actions .emotion-icon-btn[data-emotion="😊"]:hover:not(:disabled) { border-color: #4CAF50; background: rgba(76, 175, 80, 0.1); }
.running-task-panel.mini-mode .task-actions .emotion-icon-btn[data-emotion="🙂"]:hover:not(:disabled) { border-color: #8BC34A; background: rgba(139, 195, 74, 0.1); }
.running-task-panel.mini-mode .task-actions .emotion-icon-btn[data-emotion="😐"]:hover:not(:disabled) { border-color: #9E9E9E; background: rgba(158, 158, 158, 0.1); }
.running-task-panel.mini-mode .task-actions .emotion-icon-btn[data-emotion="😰"]:hover:not(:disabled) { border-color: #FF9800; background: rgba(255, 152, 0, 0.1); }
.running-task-panel.mini-mode .task-actions .emotion-icon-btn[data-emotion="😱"]:hover:not(:disabled) { border-color: #F44336; background: rgba(244, 67, 54, 0.1); }

.running-task-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.running-task-actions-row .obsidian-link-btn,
.running-task-actions-row .task-edit-btn {
  flex: 1;
  min-width: 120px;
}

/* タスク編集モーダル */
.task-edit-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1300;
}

.task-edit-modal {
  background: #1e1e1e;
  border: 1px solid #444;
  border-radius: 12px;
  min-width: 480px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.task-edit-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #333;
}

.task-edit-modal-title {
  margin: 0;
  font-size: 1.1rem;
  color: #e0e0e0;
}

.task-edit-modal-close {
  background: none;
  border: none;
  color: #999;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.task-edit-modal-close:hover {
  color: #fff;
}

.task-edit-modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 2カラムグリッド: ラベル(固定) + フィールド(可変) */
.task-edit-field-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: start;
  gap: 8px;
}

.task-edit-label {
  display: block;
  font-size: 0.85rem;
  color: #aaa;
  padding-top: 8px;
  white-space: nowrap;
}

.task-edit-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #444;
  border-radius: 6px;
  background: #2a2a2a;
  color: #e0e0e0;
  font-size: 0.9rem;
  box-sizing: border-box;
}

.task-edit-input:focus {
  outline: none;
  border-color: #555;
}

/* Description: textarea + 音声ボタン */
.task-edit-desc-wrap {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.task-edit-textarea {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid #444;
  border-radius: 6px;
  background: #2a2a2a;
  color: #e0e0e0;
  font-size: 0.9rem;
  box-sizing: border-box;
  resize: vertical;
  font-family: inherit;
  min-height: 56px;
}

.task-edit-textarea:focus {
  outline: none;
  border-color: #555;
}

.task-edit-voice-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 1px solid #444;
  border-radius: 6px;
  background: #2a2a2a;
  color: #ccc;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}

.task-edit-voice-btn:hover {
  background: #333;
  border-color: #666;
}

.task-edit-voice-btn.recording {
  background: rgba(220, 50, 50, 0.25);
  border-color: #dc3232;
  color: #ff6b6b;
  animation: voicePulse 1s ease-in-out infinite;
}

@keyframes voicePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.task-edit-input--narrow {
  max-width: 160px;
}

.task-edit-date {
  width: 100%;
  max-width: 150px;
  padding: 5px 6px;
  font-size: 0.82rem;
  border: 1px solid #444;
  border-radius: 6px;
  background: #2a2a2a;
  color: #e0e0e0;
  font-size: 0.9rem;
  box-sizing: border-box;
}

.task-edit-date:focus {
  outline: none;
  border-color: #555;
}

/* Priority ボタン: emoji + ラベルを縦積み */
.task-edit-priority-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.task-edit-priority-row .priority-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  border: 1px solid #444;
  border-radius: 8px;
  background: #2a2a2a;
  color: #999;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  min-width: 52px;
}

.task-edit-priority-row .priority-btn .priority-btn-emoji {
  font-size: 1.2rem;
  line-height: 1;
}

.task-edit-priority-row .priority-btn .priority-btn-label {
  font-size: 0.7rem;
  white-space: nowrap;
}

.task-edit-priority-row .priority-btn:hover {
  background: #333;
  color: #e0e0e0;
  border-color: #666;
}

.task-edit-priority-row .priority-btn.selected {
  border-color: #7c5cbf;
  background: rgba(124, 92, 191, 0.2);
  color: #b39ddb;
}

.task-edit-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #333;
}

.task-edit-btn-apply {
  padding: 8px 20px;
  border: none;
  border-radius: 8px;
  background: #52c41a;
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
}

.task-edit-btn-apply:hover {
  background: #73d13d;
}

.task-edit-btn-cancel {
  padding: 8px 20px;
  border: 1px solid #555;
  border-radius: 8px;
  background: transparent;
  color: #ccc;
  font-size: 0.95rem;
  cursor: pointer;
}

.task-edit-btn-cancel:hover {
  background: #333;
  color: #fff;
}

/* 半透明オーバーレイ背景は不要（全画面が背景になるため削除） */

@keyframes focusIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.focus-mode > .running-task-header {
  font-size: 1.2em;
  margin-bottom: 20px;
  color: #52c41a;
  justify-content: center;
}

.focus-mode .running-task-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* Description 行は高さ固定 */
.focus-mode .task-inline-desc-row {
  flex-shrink: 0;
}

/* メインエリア: タイマー（左正方形）＋ 右パネル */
.focus-mode .focus-main-area {
  display: flex;
  flex: 1;
  min-height: 0;
  gap: 16px;
  align-items: stretch;
}

/* タイマーコンテナ: focus-main-area の高さいっぱいの正方形 */
.focus-mode .task-timer-container {
  flex-shrink: 0;
  flex-grow: 0;
  /* align-self: stretch で高さ = focus-main-area の高さ */
  align-self: stretch;
  /* aspect-ratio: 1 で 幅 = 高さ → 正方形 */
  aspect-ratio: 1 / 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* SVG は fluid モードで 100%/100% を持つが、念のため明示 */
.focus-mode .task-timer-container svg.timer-arc {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

/* 右パネル: 編集フォーム＋アクション */
.focus-mode .task-right-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 0;
}

/* 編集パネルはスクロール可能 */
.focus-mode .task-inline-edit-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* フッター: 完了・保留ボタン（タイマー＋編集パネルを横断する全幅） */
.focus-mode .focus-footer {
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
  margin-top: 8px;
}

/* --- インライン編集: Description --------------------------------- */
.task-inline-desc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  width: 100%;
}

.task-inline-description {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  background: rgba(42,42,42,0.7);
  color: #e0e0e0;
  font-size: clamp(1.0em, 2vw, 1.3em);
  font-family: inherit;
  box-sizing: border-box;
}

.task-inline-description:focus {
  outline: none;
  border-color: rgba(82,196,26,0.5);
  background: rgba(42,42,42,0.9);
}

.task-inline-desc-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

/* --- インライン編集: 編集パネル（旧 task-metadata-display の位置） */
.task-inline-edit-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

/* 既存の 2カラムグリッド (.task-edit-field-row) はモーダルと共用するので変更不要 */

/* --- インライン Priority ボタン ---------------------------------- */
.inline-priority-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 5px 8px;
  border: 1px solid #444;
  border-radius: 7px;
  background: #2a2a2a;
  color: #888;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  min-width: 44px;
}

.inline-priority-btn .priority-btn-emoji {
  font-size: 1.1rem;
  line-height: 1;
}

.inline-priority-btn .priority-btn-label {
  font-size: 0.65rem;
  white-space: nowrap;
}

.inline-priority-btn:hover {
  background: #333;
  color: #ddd;
  border-color: #555;
}

.inline-priority-btn.selected {
  border-color: #7c5cbf;
  background: rgba(124,92,191,0.25);
  color: #b39ddb;
}

/* --- インライン 感情ボタン --------------------------------------- */
.inline-emotion-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.inline-emotion-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #444;
  border-radius: 6px;
  background: #2a2a2a;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  padding: 0;
}

.inline-emotion-btn:hover {
  background: #333;
  border-color: #666;
}

.inline-emotion-btn.selected {
  border-color: #7c5cbf;
  background: rgba(124, 92, 191, 0.25);
}

/* --- 読み取り専用フィールド ------------------------------------- */
.task-edit-readonly {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid #333;
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
  color: #888;
  font-size: 0.82rem;
  font-family: monospace;
  cursor: default;
  user-select: text;
  min-height: 32px;
  box-sizing: border-box;
  width: 100%;
}

.task-edit-readonly--history {
  font-family: inherit;
  font-size: 0.75rem;
  word-break: break-all;
  white-space: normal;
  line-height: 1.4;
}

/* --- 日付フィールド（2列グリッド） -------------------------------- */
.task-inline-dates-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
  padding: 4px 0;
}

.task-inline-dates-grid .task-edit-field-row {
  padding: 0;
}

/* 左列（奇数）: 単一列フィールドと入力開始位置を揃える */
.task-inline-dates-grid .task-edit-field-row:nth-child(odd) {
  grid-template-columns: 130px 1fr;
}

/* 右列（偶数）: キャンセル日等の長いラベルに対応 */
.task-inline-dates-grid .task-edit-field-row:nth-child(even) {
  grid-template-columns: 100px 1fr;
}

/* --- 旧参照情報エリア（廃止、後方互換のため残す） */
.task-inline-info { display: none; }

/* --- 保存ボタン -------------------------------------------------- */
.task-inline-save-btn {
  align-self: flex-end;
  padding: 6px 18px;
  border: none;
  border-radius: 7px;
  background: #3a3a3a;
  color: #ccc;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  margin-top: 4px;
}

.task-inline-save-btn:hover:not(:disabled) {
  background: #52c41a;
  color: #fff;
}

.task-inline-save-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Obsidianで開くボタン */
.obsidian-link-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin: 8px auto;
  display: block;
  -webkit-app-region: no-drag;
}

.obsidian-link-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.obsidian-link-btn:active {
  transform: translateY(0);
}

/* task-metadata-display は focus モードでは廃止。mini モード等で必要な場合に備えて最小スタイルのみ残す */
.task-metadata-display {
  display: none;
}

/* timer-metadata-container は focus-main-area に置き換え済み（後方互換のみ） */
.focus-mode .timer-metadata-container {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.focus-mode .timer-arc {
  filter: drop-shadow(0 0 20px rgba(82, 196, 26, 0.3));
}

.focus-mode .timer-arc-bg {
  opacity: 0.3;
}

.focus-mode .timer-arc-progress {
  transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}

.focus-mode .timer-arc-progress.timer-warning {
  stroke: #FFC107; /* 黄色 */
}

.focus-mode .timer-arc-progress.timer-danger {
  stroke: #F44336; /* 赤 */
}

/* プログレスサークル内の文字: font-size は SVG属性（52ユーザー単位）でスケール対応 */
.focus-mode .timer-text {
  font-weight: 700;
  fill: #52c41a;
  font-family: 'Courier New', 'Consolas', monospace;
}

.focus-mode .timer-text.timer-warning {
  fill: #FFC107;
}

.focus-mode .timer-text.timer-danger {
  fill: #F44336;
}

/* 旧スタイル（後方互換性のため残す） */
.focus-mode .task-timer {
  font-size: clamp(2.5em, 5vw, 4.5em);
  font-weight: 700;
  text-align: center;
  color: #52c41a;
  margin: 20px 0;
  font-family: 'Courier New', 'Consolas', monospace;
  text-shadow: 0 0 20px rgba(82, 196, 26, 0.5);
}

.focus-mode .task-comment-section {
  margin: 8px 0 6px;
}

.focus-mode .task-comment-label {
  display: block;
  font-size: 0.82em;
  color: #999;
  margin-bottom: 4px;
  font-weight: 500;
}

/* コメント入力行: テキスト + 音声ボタン横並び */
.task-comment-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-comment-input-row .task-comment-input {
  flex: 1;
  min-width: 0;
}

/* チャット欄と同じデザインで小さめの音声入力ボタン */
.voice-input-btn--sm {
  width: 36px !important;
  height: 36px !important;
  font-size: 1.0em !important;
  flex-shrink: 0;
}

.focus-mode .task-comment-input {
  width: 100%;
  max-width: none;  /* 制限を削除して親要素の幅を活用 */
  padding: 12px 16px;
  font-size: clamp(0.9em, 1.5vw, 1.1em);  /* 可変フォントサイズ */
  background: #2a2a2a;
  border: 2px solid #3a3a3a;
  border-radius: 8px;
  color: #e0e0e0;
  outline: none;
  transition: all 0.3s ease;
  font-family: inherit;
}

.focus-mode .task-comment-input:focus {
  border-color: #667eea;
  background: #2e2e2e;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.focus-mode .task-comment-input::placeholder {
  color: #666;
}

.focus-mode .task-actions {
  display: flex;
  flex-direction: row;  /* column → row */
  gap: 15px;
  justify-content: center;
  align-items: center;
  width: 100%;
}

/* 完了ボタンと感情統合コンテナ */
.focus-mode .complete-with-emotion-btn {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 25px;
  background: #2a2a2a;
  border: 2px solid #4a4a4a;
  border-radius: 12px;
  width: 100%;
  max-width: 650px;
  justify-content: center;
  cursor: pointer;  /* 背景クリック可能 */
  position: relative;
}

.focus-mode .complete-label {
  font-size: 1.2em;
  color: #52c41a;
  font-weight: 600;
  flex-shrink: 0;
}

/* 保留＋予測感情（🧘）選択 */
.focus-mode .pending-with-emotion-btn {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 25px;
  background: #2a2a2a;
  border: 2px solid #4a4a4a;
  border-radius: 12px;
  width: 100%;
  max-width: 650px;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.focus-mode .pending-label {
  font-size: 1.2em;
  color: #667eea;
  font-weight: 600;
  flex-shrink: 0;
}

.focus-mode .emotion-icon-btn {
  width: 50px;
  height: 50px;
  font-size: 1.8em;
  background: transparent;
  border: 2px solid #3a3a3a;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.focus-mode .emotion-icon-btn:hover:not(:disabled) {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.focus-mode .emotion-icon-btn:active:not(:disabled) {
  transform: scale(1.05);
}

.focus-mode .emotion-icon-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 各感情のホバー色 */
.focus-mode .emotion-icon-btn[data-emotion="😊"]:hover:not(:disabled) {
  border-color: #4CAF50;
  background: rgba(76, 175, 80, 0.1);
}

.focus-mode .emotion-icon-btn[data-emotion="🙂"]:hover:not(:disabled) {
  border-color: #8BC34A;
  background: rgba(139, 195, 74, 0.1);
}

.focus-mode .emotion-icon-btn[data-emotion="😐"]:hover:not(:disabled) {
  border-color: #9E9E9E;
  background: rgba(158, 158, 158, 0.1);
}

.focus-mode .emotion-icon-btn[data-emotion="😰"]:hover:not(:disabled) {
  border-color: #FF9800;
  background: rgba(255, 152, 0, 0.1);
}

.focus-mode .emotion-icon-btn[data-emotion="😱"]:hover:not(:disabled) {
  border-color: #F44336;
  background: rgba(244, 67, 54, 0.1);
}

.focus-mode .emotion-icon-btn.skip:hover:not(:disabled) {
  border-color: #666;
  background: rgba(102, 102, 102, 0.1);
}

.focus-mode .task-action-button {
  padding: 15px 35px;
  font-size: clamp(1em, 1.5vw, 1.3em);  /* 可変フォントサイズ */
  border-radius: 12px;
  min-width: clamp(150px, 15vw, 220px);  /* 可変ボタン幅 */
  background: #52c41a;
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

.focus-mode .task-action-button:hover {
  background: #73d13d;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(82, 196, 26, 0.4);
}

.focus-mode .task-action-button.secondary {
  background: #3a3a3a;
  border: 2px solid #4a4a4a;
}

.focus-mode .task-action-button.secondary:hover {
  background: #4a4a4a;
  border-color: #667eea;
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.running-task-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  font-size: 1.1em;
  font-weight: 600;
  color: #52c41a;
}

.running-task-header-actions {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

/* ヘッダー内のボタンはデザインを統一（モードトグル・Vault等） */
.running-task-header-actions .pomodoro-mode-toggle-btn,
.running-task-header-actions .task-icon-btn {
  position: static;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: background 0.2s, border-color 0.2s;
}

.running-task-header-actions .pomodoro-mode-toggle-btn:hover,
.running-task-header-actions .task-icon-btn:hover {
  background: rgba(82, 196, 26, 0.2);
  border-color: rgba(82, 196, 26, 0.5);
}

.running-task-icon {
  font-size: 1.5em;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.running-task-content {
  background: #1e1e1e;
  border-radius: 8px;
  padding: 15px;
}

/* ポモドーロタイマー */
.pomodoro-timer-section {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.pomodoro-timer {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #2a2a2a;
  border: 2px solid #52c41a;
  border-radius: 50px;
  padding: 15px 30px;
  transition: all 0.3s ease;
}

.pomodoro-timer.timer-warning {
  border-color: #faad14;
  background: #3a2a1a;
}

.pomodoro-timer.timer-danger {
  border-color: #ff4d4f;
  background: #3a1a1a;
  animation: timerPulse 1s infinite;
}

@keyframes timerPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.timer-icon {
  font-size: 2em;
}

.timer-display {
  font-size: 2.5em;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  color: #52c41a;
  min-width: 120px;
  text-align: center;
}

.pomodoro-timer.timer-warning .timer-display {
  color: #faad14;
}

.pomodoro-timer.timer-danger .timer-display {
  color: #ff4d4f;
}

/* タスク履歴 */
.task-history {
  background: #2a2a1a;
  border-left: 3px solid #faad14;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 15px;
}

.history-title {
  font-size: 0.9em;
  color: #faad14;
  font-weight: 600;
  margin-bottom: 8px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85em;
  color: #999;
  padding: 4px 0;
}

.history-icon {
  font-size: 1.2em;
}

.history-time {
  color: #ccc;
  font-family: 'Courier New', monospace;
}

.history-note {
  color: #999;
  font-style: italic;
}

.task-text {
  color: #e0e0e0;
  font-size: 1.05em;
  margin-bottom: 15px;
  line-height: 1.5;
}

.task-meta {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  font-size: 0.9em;
  color: #999;
}

.task-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.task-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.task-action-btn {
  background: #52c41a;
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 0.95em;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-action-btn:hover {
  background: #73d13d;
  transform: translateY(-2px);
}

.task-action-btn.secondary {
  background: #3a3a3a;
}

.task-action-btn.secondary:hover {
  background: #4a4a4a;
}

.task-action-btn.danger {
  background: #ff4d4f;
}

.task-action-btn.danger:hover {
  background: #ff7875;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.message {
  display: flex;
  gap: 12px;
  animation: slideIn 0.3s ease;
}

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

.message.higherself {
  align-self: flex-start;
  max-width: 80%;
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
  max-width: 80%;
}

.message-avatar {
  font-size: 2em;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.message.higherself .message-avatar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.message.user .message-avatar {
  background: #3a3a3a;
}

.message-content {
  background: #2a2a2a;
  border-radius: 12px;
  padding: 15px 18px;
  position: relative;
}

.message.higherself .message-content {
  border-top-left-radius: 4px;
  border-left: 3px solid #667eea;
}

.message.user .message-content {
  border-top-right-radius: 4px;
  background: #3a3a3a;
}

.message-text {
  color: #e0e0e0;
  line-height: 1.5;
  margin: 0;
}

.command-badge {
  display: inline-block;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 0.75em;
  padding: 2px 8px;
  border-radius: 8px;
  margin-left: 6px;
  font-weight: 600;
  vertical-align: middle;
}

.message-time {
  font-size: 0.75em;
  color: #666;
  margin-top: 8px;
  display: block;
}

.message-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.stat-item {
  background: #1e1e1e;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9em;
}

.stat-label {
  color: #999;
  font-size: 0.85em;
  margin-bottom: 3px;
}

.stat-value {
  color: #667eea;
  font-weight: 600;
  font-size: 1.1em;
}

.message-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* 感情ボタン用のレイアウト（横並び、左がポジティブ、右がネガティブ） */
.message-actions.emotion-actions {
  justify-content: center;
  gap: 4px;
  margin-top: 16px;
  /* 小さい幅のときにボタンが切れて見えるため、改行を許可する */
  flex-wrap: wrap;
}

.message-action-btn {
  background: #667eea;
  color: white;
  border: none;
  padding: 8px 16px;
  font-size: 0.9em;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.message-action-btn:hover {
  background: #764ba2;
  transform: translateY(-1px);
}

.message-action-btn.secondary {
  background: #3a3a3a;
}

.message-action-btn.secondary:hover {
  background: #4a4a4a;
}

/* 感情ボタンのスタイル（絵文字のみ、背景色でポジティブ/ネガティブを表現） */
.message-action-btn.emotion {
  padding: 8px 12px;
  font-size: 1.2em;
  border-radius: 6px;
  min-width: 40px;
  width: 40px;
  height: 40px;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #333 0%, #2a2a2a 100%);
  border: 2px solid #444;
  position: relative;
  flex-shrink: 0; /* 縮小しない */
}

/* ポジティブ（😊, 🙂） */
.message-action-btn.emotion[data-emotion-level="2"] {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  border-color: #66bb6a;
}

.message-action-btn.emotion[data-emotion-level="1"] {
  background: linear-gradient(135deg, #8BC34A 0%, #7cb342 100%);
  border-color: #9ccc65;
}

/* ニュートラル（😐） */
.message-action-btn.emotion[data-emotion-level="0"] {
  background: linear-gradient(135deg, #9E9E9E 0%, #757575 100%);
  border-color: #bdbdbd;
}

/* ネガティブ（😤, 😱） */
.message-action-btn.emotion[data-emotion-level="-1"] {
  background: linear-gradient(135deg, #FF9800 0%, #f57c00 100%);
  border-color: #ffb74d;
}

.message-action-btn.emotion[data-emotion-level="-2"] {
  background: linear-gradient(135deg, #F44336 0%, #d32f2f 100%);
  border-color: #ef5350;
}

/* スキップボタン（感情なし） */
.message-action-btn.emotion.skip {
  background: linear-gradient(135deg, #616161 0%, #424242 100%);
  border-color: #757575;
}

/* 感情ボタンのホバー効果 */
.message-action-btn.emotion:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  filter: brightness(1.1);
}

/* 感情ボタンのクリック効果 */
.message-action-btn.emotion:active {
  transform: scale(1.05);
}

.progress-message {
  background: #1e2e1e;
  border-left-color: #52c41a;
}

.progress-dots {
  display: inline-block;
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

.quick-actions {
  display: flex;
  gap: 10px;
  padding: 15px 0;
  border-top: 1px solid #3a3a3a;
  flex-wrap: wrap;
}

.quick-action-btn {
  background: #2a2a2a;
  color: #e0e0e0;
  border: 1px solid #3a3a3a;
  padding: 12px 20px;
  font-size: 0.95em;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 150px;
  justify-content: center;
}

.quick-action-btn:hover {
  background: #3a3a3a;
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.quick-action-btn:active {
  transform: translateY(0);
}

.action-icon {
  font-size: 1.2em;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: #667eea;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* スクロールバーのスタイル */
.messages::-webkit-scrollbar {
  width: 8px;
}

.messages::-webkit-scrollbar-track {
  background: #1e1e1e;
  border-radius: 4px;
}

.messages::-webkit-scrollbar-thumb {
  background: #4a4a4a;
  border-radius: 4px;
}

.messages::-webkit-scrollbar-thumb:hover {
  background: #5a5a5a;
}

/* 成功メッセージ */
.message.success .message-content {
  border-left-color: #52c41a;
  background: #1e2e1e;
}

/* エラーメッセージ */
.message.error .message-content {
  border-left-color: #ff4d4f;
  background: #2e1e1e;
}

/* タスクサイドバー */
.task-sidebar {
  width: 400px;
  min-width: 300px;
  max-width: 800px;
  flex-shrink: 0;
  background: #2a2a2a;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* スクロール可能に保つ */
  border: 1px solid #3a3a3a;
  position: relative;
}

/* サイドバーリサイザー */
.sidebar-resizer {
  position: absolute;
  left: -6px;
  top: 0;
  bottom: 0;
  width: 12px;
  cursor: ew-resize;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-resizer::before {
  content: '';
  width: 2px;
  height: 40px;
  background: #4a4a4a;
  border-radius: 2px;
  transition: all 0.2s ease;
}

.sidebar-resizer:hover::before {
  background: #667eea;
  height: 60px;
  width: 3px;
}

.sidebar-resizer.resizing::before {
  background: #667eea;
  height: 100%;
  width: 3px;
}

/* sidebar-headerとsidebar-refresh-btnは削除（不要） */

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden; /* スクロール可能に保つ */
  padding-top: 10px;
}

.sidebar-content::-webkit-scrollbar {
  width: 8px;
}

.sidebar-content::-webkit-scrollbar-track {
  background: #2a2a2a;
  border-radius: 4px;
}

.sidebar-content::-webkit-scrollbar-thumb {
  background: #4a4a4a;
  border-radius: 4px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
  background: #5a5a5a;
}

.task-section {
  margin-bottom: 25px;
}

/* 完了タスクセクション */
.completed-section .task-list {
  opacity: 0.6;
}

.completed-section .task-item {
  pointer-events: none;
  cursor: default;
  opacity: 0.7;
}

.completed-section .task-item:hover {
  background: #2a2a2a;
  transform: none;
}

.task-section-title {
  font-size: 0.9em;
  color: #999;
  margin: 0 0 10px 0;
  padding: 5px 10px;
  background: #333;
  border-radius: 6px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-section-title.collapsible {
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.task-section-title.collapsible:hover {
  background: #3a3a3a;
}

.collapse-icon {
  font-size: 0.8em;
  color: #666;
  transition: transform 0.2s ease;
  display: inline-block;
  width: 12px;
}

.task-count {
  margin-left: auto;
  font-size: 0.85em;
  color: #888;
  font-weight: 400;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
  max-height: 5000px; /* 十分大きな値で展開状態を表現 */
  opacity: 1;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.task-list.collapsed {
  max-height: 0 !important;
  opacity: 0;
}

.task-list-loading {
  color: #999;
  font-size: 0.9em;
  padding: 10px;
  text-align: center;
}

.task-list-empty {
  color: #666;
  font-size: 0.85em;
  padding: 10px;
  text-align: center;
  font-style: italic;
}

.task-item {
  background: #333;
  padding: 10px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  position: relative;
  cursor: pointer;
  display: block;
  min-width: 0;
}

/* 実行中タスク（ポモドーロでピック済み）のハイライト */
.task-item-running {
  border-left-color: #52c41a;
  background: rgba(82, 196, 26, 0.12);
  box-shadow: 0 0 0 1px rgba(82, 196, 26, 0.3);
}

/* 横並びメインコンテナ（ボタン + コンテンツ） */
.task-item-main {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

/* 親タスクの場合、親子情報のためのスペースを確保 */
.task-item-parent .task-item-main {
  margin-top: 18px;
}

/* タスクコンテンツと フッターの縦並びコンテナ */
.task-item-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

/* 親タスクのスタイル */
.task-item-parent {
  /* 通常タスクと同じ見た目 */
}

.task-item-parent:hover {
  /* .task-item:hoverと同じスタイルを継承 */
}

/* 子タスクのスタイル */
.task-item-child {
  /* 通常タスクと同じ見た目 */
  margin-left: 20px; /* インデントを維持 */
  position: relative;
}

.task-item-child::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #3a3a3a; /* ツリー構造を示す控えめな縦ライン */
}

.task-item-child:hover {
  /* .task-item:hoverと同じスタイルを継承 */
}

/* ネスト表示された子タスク（親の直下に展開） */
.task-item-child-nested {
  margin-left: 24px;
  margin-top: 4px;
  margin-bottom: 0;
  border-left-width: 2px;
  animation: slideDown 0.2s ease;
}

.task-item-child-nested::before {
  left: -24px;
  width: 20px;
  height: 2px;
  top: 50%;
  bottom: auto;
  background: #3a3a3a; /* ツリー構造を示す控えめな横ライン */
  transform: translateY(-50%);
}

.task-item-child-nested::after {
  content: '';
  position: absolute;
  left: -24px;
  top: -4px;
  bottom: 50%;
  width: 2px;
  background: #3a3a3a; /* ツリー構造を示す控えめな縦ライン */
}

.task-item-child-nested-last::after {
  display: none;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    max-height: 100px;
    transform: translateY(0);
  }
}

.task-item:hover {
  background: #3a3a3a;
  border-left-color: #667eea;
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.task-item:active {
  transform: translateX(1px);
}

/* 親子関係情報 */
.task-parent-info {
  font-size: 0.7em;
  color: #666; /* 暗いグレー */
  font-weight: 400; /* やや細めに */
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  user-select: none;
  padding: 1px 3px;
  border-radius: 3px;
  transition: background 0.2s ease;
  flex-shrink: 0;
  position: absolute;
  top: 2px;
  left: 6px;
  z-index: 10;
}

.task-parent-info:hover {
  background: rgba(102, 102, 102, 0.1); /* 暗いグレーに変更 */
  color: #888; /* ホバー時は少し明るく */
}

.task-parent-expand-icon {
  font-size: 0.9em;
  display: inline-block;
  width: 10px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

/* 子タスクマーカー：メタアイコンと同じスタイル */
.task-child-marker {
  color: #4CAF50;
  font-weight: 500;
  margin-right: 2px;
}

.task-item-content {
  color: #e0e0e0;
  font-size: 0.88em;
  line-height: 1.45;
  padding-right: 10px;
  flex: 1;
  min-width: 0;
  min-height: 1.3em;
  word-break: break-word;
  overflow-wrap: break-word;
}

.task-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 0.72em;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.task-item-meta-icons {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}

.task-meta-icon {
  position: relative;
  cursor: help;
}

/* ツールチップ：絵文字の右側に表示 */
.task-meta-icon[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 8px); /* 絵文字の右側に配置 */
  top: 50%;
  transform: translateY(-50%); /* 縦方向中央揃え */
  background: #1a1a1a;
  color: #e0e0e0;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.85em;
  white-space: nowrap;
  z-index: 99999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border: 1px solid #3a3a3a;
  pointer-events: none;
}

/* 矢印は不要（右側表示のため） */

.task-item-file-link {
  color: #764ba2;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 3px;
  transition: all 0.2s ease;
  position: relative;
  flex-shrink: 0;
}

.task-item-file-link:hover {
  color: #9575cd;
  text-decoration: underline;
}

/* ファイルリンクのツールチップ：右側に表示 */
.task-item-file-link[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 8px); /* リンクの右側に配置 */
  top: 50%;
  transform: translateY(-50%); /* 縦方向中央揃え */
  background: #1a1a1a;
  color: #e0e0e0;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 1.1em;
  white-space: nowrap;
  z-index: 99999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border: 1px solid #3a3a3a;
  pointer-events: none;
}

/* 旧スタイル（削除予定、互換性のため残す） */
/* .task-item-main は新レイアウトで使用中のためコメントアウト */

.task-item-meta {
  display: none;
}

.task-item-file {
  display: none;
}

.task-item-score {
  display: none;
}

.task-item-actions {
  display: none;
}

.task-action-btn {
  display: none;
}

.task-action-pick:hover {
  display: none;
}

.task-action-open:hover {
  display: none;
}

/* 設定セクション */
.settings-section {
  margin-top: auto;
  padding-top: 15px;
  border-top: 2px solid #3a3a3a;
}

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e0e0e0;
  font-size: 0.9em;
  cursor: pointer;
}

.setting-label input[type="checkbox"] {
  cursor: pointer;
}

.setting-select {
  flex: 1;
  background: #2a2a2a;
  color: #e0e0e0;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.85em;
  cursor: pointer;
}

.setting-select:focus {
  outline: none;
  border-color: #667eea;
}

.setting-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: #3a3a3a;
  outline: none;
}

.setting-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #667eea;
  cursor: pointer;
}

.setting-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #667eea;
  cursor: pointer;
  border: none;
}

.setting-test-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.setting-test-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.setting-test-btn:active {
  transform: translateY(0);
}

#volumeValue {
  min-width: 40px;
  text-align: right;
  font-size: 0.85em;
  color: #999;
  font-family: 'Courier New', 'Consolas', monospace;
}

/* チャット入力欄 */
.chat-input-container {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 0;
  border-top: 1px solid #3a3a3a;
  -webkit-app-region: no-drag;
}

.voice-input-btn {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.5em;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(245, 87, 108, 0.3);
}

.voice-input-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(245, 87, 108, 0.5);
}

.voice-input-btn:active {
  transform: scale(0.95);
}

.voice-input-btn.disabled {
  background: #555;
  cursor: not-allowed;
  opacity: 0.4;
  pointer-events: none;
}

.voice-input-btn.recording {
  animation: recordingPulse 0.8s ease-in-out infinite;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
}

@keyframes recordingPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 0 10px rgba(255, 107, 107, 0);
  }
}

/* 録音中のアイコン回転 */
.voice-input-btn.recording span {
  animation: iconRotate 2s linear infinite;
}

@keyframes iconRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* VUメーター（録音中の音声レベル表示） */
.vu-meter {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  padding: 20px 30px;
  border-radius: 16px;
  min-width: 320px;
  z-index: 10000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: vuMeterFadeIn 0.3s ease-out;
}

@keyframes vuMeterFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.vu-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #fff;
}

.vu-icon {
  font-size: 1.4em;
  animation: vuIconPulse 1.5s ease-in-out infinite;
}

@keyframes vuIconPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.vu-label {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.vu-bar-container {
  width: 100%;
  height: 28px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  margin-bottom: 10px;
}

.vu-bar {
  height: 100%;
  background: linear-gradient(90deg, #4caf50 0%, #8bc34a 50%, #ffc107 80%, #f44336 100%);
  transition: width 0.1s ease-out;
  border-radius: 14px;
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
  position: relative;
}

.vu-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
  animation: vuBarShine 2s linear infinite;
}

@keyframes vuBarShine {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.vu-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
}

#vuPercentage {
  font-weight: 700;
  font-size: 14px;
  color: #4caf50;
  min-width: 40px;
}

#vuMessage {
  font-style: italic;
  opacity: 0.7;
}

.chat-input {
  flex: 1;
  background: #2d2d2d;
  border: 2px solid #3a3a3a;
  border-radius: 24px;
  padding: 12px 20px;
  color: #e0e0e0;
  font-size: 0.95em;
  transition: all 0.3s ease;
  outline: none;
}

.chat-input:focus {
  border-color: #667eea;
  background: #333;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chat-input::placeholder {
  color: #666;
}

.chat-send-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.3em;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.chat-send-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.5);
}

.chat-send-btn:active:not(:disabled) {
  transform: translateY(0);
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* コマンドメッセージ */
.message.command .message-content {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
  border: 2px solid rgba(102, 126, 234, 0.5);
  border-radius: 20px;
  padding: 12px 20px;
  display: inline-block;
  position: relative;
}

.message.command .message-content::before {
  content: '⚡ コマンド';
  position: absolute;
  top: -10px;
  left: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 0.7em;
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ========================================
   ヘルプボタン（チャットエリア右上に浮遊）
   ======================================== */
.quick-cmd-toolbar {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 10;
  -webkit-app-region: no-drag;
}

.quick-cmd-row {
  display: flex;
  flex-direction: row;
  gap: 5px;
  justify-content: flex-end;
}

.quick-cmd-btn {
  position: relative;
  background: #3a3a3a;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  padding: 0;
}

.quick-cmd-btn:hover {
  background: #555;
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.quick-cmd-btn:active {
  transform: scale(0.95);
}

/* 外部アプリ連携ボタン（角丸矩形） */
.quick-cmd-btn.ext-btn {
  border-radius: 6px;
  width: 28px;
  height: 22px;
  font-size: 0.8em;
  opacity: 0.75;
}
.quick-cmd-btn.ext-btn:hover {
  opacity: 1;
}

/* 休憩中モードがアクティブなときのボタン */
.quick-cmd-btn.break-active,
.quick-cmd-btn.break-active:hover {
  background: linear-gradient(135deg, #4a90d9 0%, #2563eb 100%);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.6), 0 2px 8px rgba(37, 99, 235, 0.4);
  animation: break-pulse 2.5s ease-in-out infinite;
}
@keyframes break-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.6), 0 2px 8px rgba(37, 99, 235, 0.4); }
  50%       { box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.3), 0 4px 16px rgba(37, 99, 235, 0.6); }
}

/* カスタムツールチップ（JS で #quickCmdTooltip を制御） */
#quickCmdTooltip {
  position: fixed;
  background: rgba(20, 20, 30, 0.92);
  color: #fff;
  font-size: 0.72em;
  white-space: nowrap;
  padding: 4px 9px;
  border-radius: 5px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  z-index: 9999;
}

/* 後方互換: help-btn クラスが残っている場合 */
.help-btn {
  display: none;
}

/* ========================================
   タスクピックアップボタン（チャット入力欄の横、小さめ）
   ======================================== */
.pick-task-btn-small {
  background: linear-gradient(135deg, #FF6B6B 0%, #4ECDC4 100%);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.3em;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
  flex-shrink: 0;
  -webkit-app-region: no-drag;
}

.pick-task-btn-small:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 16px rgba(255, 107, 107, 0.5);
}

.pick-task-btn-small:active {
  transform: translateY(0);
}

/* 旧スタイル（削除予定、互換性のため残す） */
.pick-task-btn {
  display: none;
}

.pick-task-icon {
  font-size: 1.3em;
}

.pick-task-text {
  letter-spacing: 0.5px;
}

/* ウィジェット更新ボタンは削除済み（タスクリストヘッダーに統合） */

/* ========================================
   HigherSelfチャット - 感情選択ボタン
   ======================================== */
.emotion-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}

.emotion-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #333 0%, #2a2a2a 100%);
  border: 1px solid #444;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95em;
}

.emotion-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #3a3a3a 0%, #333 100%);
  border-color: #555;
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.emotion-btn:active:not(:disabled) {
  transform: translateX(2px);
}

.emotion-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.emotion-emoji {
  font-size: 1.5em;
  flex-shrink: 0;
}

.emotion-label {
  flex: 1;
  text-align: left;
}

/* 感情ごとの色付け（ホバー時） */
.emotion-btn:hover:not(:disabled) .emotion-emoji {
  filter: drop-shadow(0 0 4px currentColor);
}

.emotion-btn[data-emoji="😊"]:hover:not(:disabled) {
  border-color: #4CAF50;
}

.emotion-btn[data-emoji="🙂"]:hover:not(:disabled) {
  border-color: #8BC34A;
}

.emotion-btn[data-emoji="😐"]:hover:not(:disabled) {
  border-color: #9E9E9E;
}

.emotion-btn[data-emoji="😰"]:hover:not(:disabled) {
  border-color: #FF9800;
}

.emotion-btn[data-emoji="😱"]:hover:not(:disabled) {
  border-color: #F44336;
}

/* 完了時の感情選択ボタン（追加スタイル） */
.completion-emotion-btn {
  /* 予定時と同じスタイルを継承 */
}

/* ========================================
   AI機能スタイル
   ======================================== */

/* タイピングカーソルアニメーション */
.typing-cursor {
  animation: blink 1s infinite;
  color: #667eea;
  font-weight: bold;
  margin-left: 2px;
}

@keyframes blink {
  0%, 49% {
    opacity: 1;
  }
  50%, 100% {
    opacity: 0;
  }
}

/* ストリーミング中のメッセージ */
.message.higherself.streaming {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
  border-left: 3px solid #667eea;
}

/* AIエラーメッセージ */
.message.higherself.error {
  background: linear-gradient(135deg, rgba(244, 67, 54, 0.15) 0%, rgba(229, 57, 53, 0.15) 100%);
  border-left: 3px solid #f44336;
  color: #ff6b6b;
}

/* 日付区切り線（大きめ） */
.date-divider {
  display: flex;
  align-items: center;
  margin: 30px 0 25px 0;
  opacity: 0.7;
}

.date-line {
  flex: 1;
  border: none;
  border-top: 2px solid #667eea;
  margin: 0;
}

.date-label {
  padding: 0 20px;
  font-size: 1em;
  color: #667eea;
  white-space: nowrap;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* セッション区切り線（小さめ） */
.session-divider {
  display: flex;
  align-items: center;
  margin: 15px 0;
  opacity: 0.4;
}

.session-line {
  flex: 1;
  border: none;
  border-top: 1px solid #555;
  margin: 0;
}

.session-label {
  padding: 0 12px;
  font-size: 0.8em;
  color: #888;
  white-space: nowrap;
  font-weight: 400;
}

/* 設定項目の区切り線 */
.setting-divider {
  height: 1px;
  background: #3a3a3a;
  margin: 15px 0;
}

/* ========================================
   レスポンシブ対応
   ======================================== */

/* 最小サイズ（1200x750）での調整 */
@media (max-width: 1200px), (max-height: 750px) {
  .widget-grid {
    --widget-cell-size: 100px;
    display: grid;
    grid-template-columns: repeat(auto-fit, var(--widget-cell-size));
    grid-auto-rows: var(--widget-cell-size);
    gap: 12px;
    padding: 10px;
    -webkit-app-region: no-drag;
  }
  .widget-tile {
    padding: 8px;
  }
  .kpi-widget.kpi-widget-single .kpi-widget-title {
    font-size: 0.62em;
  }
  .kpi-widget.kpi-widget-single .kpi-widget-value-line {
    font-size: 0.88em;
  }
  .kpi-widget.kpi-widget-single .kpi-widget-target-line,
  .kpi-widget.kpi-widget-single .kpi-widget-diff-line {
    font-size: 0.55em;
  }
  .kpi-widget.kpi-widget-single .kpi-widget-last-updated {
    font-size: 0.5em;
  }
  
  .widget-clock-svg {
    max-height: 96px;
    min-height: 72px;
  }
  
  .widget-label, .widget-header {
    font-size: 0.6em;
  }
  
  .widget-value, .digital-time {
    font-size: 0.9em;
  }
  
  .task-list-container {
    padding: 10px;
  }
}

/* 極小サイズでの調整 */
@media (max-width: 1000px) {
  .left-panel {
    width: 35%;
  }
  
  .right-panel {
    width: 65%;
  }
  
  .clock-widget {
    display: none; /* 時計ウィジェットを非表示 */
  }
  .clock-period-legend .period-item {
    font-size: 0.75em;
  }
}

/* ========================================
   長押し完了ボタン (Hold to Complete Button)
   ======================================== */

/* CSS変数の追加 */
:root {
  --hold-duration: 1000ms;
  --hold-accent-color: #3b82f6;
  --hold-accent-glow: #60a5fa;
  --hold-success-color: #22c55e;
  --hold-button-size: 32px;
}

/* ボタンコンテナ（ヒントは廃止、ホバーでツールチップ表示） */
.hold-button-container {
  position: relative;
  width: var(--hold-button-size);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
}

/* 長押しボタンのツールチップ（既存メタアイコンと同じスタイル・即時表示） */
.hold-button-container[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: #1a1a1a;
  color: #e0e0e0;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.85em;
  white-space: nowrap;
  z-index: 99999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border: 1px solid #3a3a3a;
  pointer-events: none;
}

/* ボタン本体 */
.hold-button {
  appearance: none;
  background: transparent;
  border: none;
  cursor: pointer;
  width: var(--hold-button-size);
  height: var(--hold-button-size);
  padding: 0;
  position: relative;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  flex-shrink: 0;
}

/* ボタン内側の円 */
.hold-button::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: transparent;
  border: 3px solid rgba(255, 255, 255, 0.2);
  box-sizing: border-box;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 0px var(--hold-accent-glow);
}

/* 完了状態のボタン */
.task-item-completed .hold-button::after,
.hold-button.completed::after {
  background-color: var(--hold-success-color);
  border-color: var(--hold-success-color);
  box-shadow: 0 0 15px var(--hold-success-color);
}

/* SVGプログレスリング */
.progress-ring {
  position: absolute;
  top: 0;
  left: 0;
  transform: rotate(-90deg);
  pointer-events: none;
}

.progress-ring__circle {
  stroke: var(--hold-accent-color);
  stroke-dasharray: 163.36;
  stroke-dashoffset: 163.36;
  transition: none;
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px var(--hold-accent-glow));
  opacity: 0;
}

/* 長押し中のボタン状態 */
.hold-button:active::after {
  transform: scale(0.95);
}

.hold-button.is-holding::after {
  background-color: rgba(59, 130, 246, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 15px var(--hold-accent-glow);
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

.hold-button.is-holding .progress-ring__circle {
  opacity: 1;
}

/* チェックマークアイコン */
.hold-button .icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 2;
}

.task-item-completed .hold-button .icon,
.hold-button.completed .icon {
  transform: translate(-50%, -50%) scale(1);
}

/* ========================================
   Markdownインポートモーダル
   ======================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-content {
  background: #1e1e2e;
  border: 1px solid #444;
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.modal-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #e0e0e0;
}

.modal-description {
  margin: 0;
  font-size: 0.82rem;
  color: #888;
  line-height: 1.5;
}

.modal-description code {
  background: #2a2a3e;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: 'Share Tech Mono', monospace;
  color: #a0c4ff;
}

.modal-textarea {
  width: 100%;
  box-sizing: border-box;
  background: #13131f;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 10px 12px;
  color: #d0d0d0;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}

.modal-textarea:focus {
  border-color: #6a9fd8;
}

.modal-preview-count {
  font-size: 0.8rem;
  color: #7ec8a0;
  min-height: 1.2em;
}

.modal-preview-count.warn {
  color: #f0a050;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.modal-btn {
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, background 0.15s;
}

.modal-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.modal-btn-primary {
  background: #4a7fcc;
  color: #fff;
}

.modal-btn-primary:hover:not(:disabled) {
  background: #5a8fdc;
}

.modal-btn-secondary {
  background: #333;
  color: #ccc;
}

.modal-btn-secondary:hover {
  background: #444;
}
