/* ===== ログイン画面 ===== */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: var(--bg-primary);
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 360px;
  max-width: 90vw;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}

.login-logo h1 {
  font-size: 20px;
  font-weight: 700;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-group input {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  padding: 10px 12px;
  font-family: var(--font);
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.login-error {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
}

.btn-login {
  padding: 11px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  transition: all 0.15s;
  margin-top: 4px;
}

.btn-login:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

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

/* ===== ワークスペース切り替え ===== */
.workspace-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
}

#workspace-select {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  padding: 4px 8px;
  font-family: var(--font);
  cursor: pointer;
  max-width: 140px;
}

#workspace-select:focus {
  outline: none;
  border-color: var(--accent);
}

.workspace-rename-input {
  background: var(--bg-tertiary);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  padding: 4px 8px;
  font-family: var(--font);
  width: 130px;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.workspace-rename-input:focus {
  outline: none;
}

.btn-ws-rename {
  font-size: 13px;
}

.btn-ws-add {
  font-size: 16px;
  font-weight: 700;
}

/* ===== リセット & ベース ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d27;
  --bg-tertiary: #22263a;
  --bg-card: #1e2130;
  --border: #2d3352;
  --border-light: #3a4066;
  --accent: #6366f1;
  --accent-hover: #4f52d6;
  --accent-glow: rgba(99, 102, 241, 0.15);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --user-bubble: #1e3a5f;
  --ai-bubble: #1e2130;
  --scrollbar: #2d3352;
  --font: 'Segoe UI', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
}

/* ===== スクロールバー ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ===== アプリレイアウト ===== */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ===== ヘッダー ===== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 52px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 10;
}

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

.header-icon {
  width: 30px;
  height: 30px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: white;
  font-weight: bold;
}

.app-header h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 13px;
}

/* ===== メインボディ ===== */
.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ===== タスクパネル (左) ===== */
.task-panel {
  width: 300px;
  min-width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel-header h2 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.task-section {
  flex-shrink: 0;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  letter-spacing: 0.04em;
}

.section-title:hover {
  color: var(--text-primary);
}

.section-icon {
  font-size: 13px;
}

.task-count {
  margin-left: auto;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 500;
}

.task-list {
  list-style: none;
  padding: 0 8px 6px;
  overflow-y: auto;
  max-height: 180px;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.task-item:hover {
  background: var(--bg-tertiary);
}

.task-item.done {
  opacity: 0.45;
}

.task-checkbox {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-light);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  cursor: pointer;
}

.task-item.done .task-checkbox {
  background: var(--success);
  border-color: var(--success);
  color: white;
  font-size: 10px;
}

.task-item.done .task-checkbox::after {
  content: '✓';
}

.task-item:not(.done) .task-checkbox:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.task-title {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
  flex: 1;
  min-width: 0;
  word-break: break-all;
}

.task-item.done .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-dates {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.task-created {
  font-size: 11px;
  color: var(--text-muted);
}

.task-date-sep {
  font-size: 10px;
  color: var(--border-light);
}

.task-due {
  font-size: 11px;
  color: var(--text-muted);
}

.task-due.overdue {
  color: var(--danger);
  font-weight: 600;
}

.meeting-item {
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.meeting-item:hover {
  background: var(--bg-tertiary);
}

.meeting-time {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

.meeting-title-text {
  font-size: 13px;
  color: var(--text-primary);
}

.panel-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.date-view-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.date-view-controls {
  display: flex;
  gap: 6px;
}

#date-picker {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  padding: 5px 8px;
  font-family: var(--font);
  cursor: pointer;
  color-scheme: dark;
}

#date-picker:focus {
  outline: none;
  border-color: var(--accent);
}

.btn-date-view {
  padding: 5px 10px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-date-view:hover {
  background: var(--accent-hover);
}

/* ===== タブバー ===== */
.main-tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.main-tab {
  padding: 10px 22px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  margin-bottom: -1px;
}

.main-tab:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.main-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ===== タブペイン ===== */
.tab-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* ===== メモ: ページタブ全体レイアウト ===== */
.memo-layout {
  flex-direction: row !important;
}

/* ===== メモ: サイドバー ===== */
.memo-sidebar {
  width: 240px;
  min-width: 180px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.memo-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.memo-sidebar-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.memo-page-tree {
  flex: 1;
  overflow-y: auto;
  padding: 6px 4px;
}

.memo-tree-empty {
  padding: 20px 16px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

/* ===== メモ: ツリーアイテム ===== */
.memo-tree-item {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s;
  min-height: 30px;
  user-select: none;
}

.memo-tree-item:hover {
  background: var(--bg-tertiary);
}

.memo-tree-item.active {
  background: var(--accent-glow);
}

.memo-tree-toggle {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  transition: color 0.12s, background 0.12s;
}

.memo-tree-toggle:hover {
  color: var(--text-primary);
  background: var(--border);
}

.memo-tree-item-title {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.memo-tree-item.active .memo-tree-item-title {
  color: var(--accent);
  font-weight: 500;
}

.memo-tree-item-actions {
  display: flex;
  gap: 1px;
  opacity: 0;
  transition: opacity 0.12s;
  flex-shrink: 0;
}

.memo-tree-item:hover .memo-tree-item-actions {
  opacity: 1;
}

/* ===== ドラッグ&ドロップ ===== */
.memo-tree-item[draggable="true"] {
  cursor: grab;
}

.memo-tree-item[draggable="true"]:active {
  cursor: grabbing;
}

.memo-tree-item.dragging {
  opacity: 0.3;
  pointer-events: none;
}

.memo-tree-item.drop-before {
  box-shadow: inset 0 3px 0 -1px var(--accent);
}

.memo-tree-item.drop-after {
  box-shadow: inset 0 -3px 0 -1px var(--accent);
}

.memo-tree-item.drop-child {
  background: var(--accent-glow) !important;
  outline: 1px solid var(--accent);
  border-radius: var(--radius-sm);
}

.memo-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  transition: all 0.12s;
  line-height: 1.4;
}

.memo-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.memo-btn.delete:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

/* ===== メモ: エディターエリア ===== */
.memo-editor-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-primary);
  min-width: 0;
}

.memo-editor-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 40px;
}

.memo-placeholder-icon {
  font-size: 48px;
  opacity: 0.4;
}

.memo-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.memo-editor-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 48px 64px;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  min-height: 0;
}

.memo-editor-title {
  font-size: 30px;
  font-weight: 700;
  color: var(--text-primary);
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font);
  padding: 0 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  width: 100%;
  letter-spacing: -0.01em;
}

.memo-editor-title::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.memo-editor-body {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.8;
  resize: none;
  min-height: 300px;
  padding: 0;
}

.memo-editor-body::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

/* ===== メモ: プルタブ ===== */
.memo-sidebar-pull {
  display: none;
  position: absolute;
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 52px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 15px;
  z-index: 21;
  padding: 0;
  font-family: var(--font);
  transition: color 0.15s, background 0.15s;
}

.memo-sidebar-pull:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

/* ===== メモ: モバイル対応 ===== */
@media (max-width: 768px) {
  .memo-layout {
    position: relative;
    overflow: hidden;
  }

  .memo-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 20;
    transform: translateX(0);
    transition: transform 0.28s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    width: 220px;
    min-width: 220px;
  }

  .memo-sidebar.collapsed {
    transform: translateX(-100%);
  }

  .memo-sidebar-pull {
    display: flex;
  }

  .memo-editor-inner {
    padding: 24px 20px;
  }

  .memo-editor-title {
    font-size: 22px;
  }
}

/* ===== チャットエリア (右) ===== */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-primary);
}

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

/* ===== メッセージ ===== */
.message {
  display: flex;
  gap: 10px;
  max-width: 820px;
}

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

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.message.assistant .message-avatar {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: white;
}

.message.user .message-avatar {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 13px;
}

.message-bubble {
  padding: 12px 16px;
  border-radius: var(--radius);
  max-width: 680px;
  line-height: 1.65;
}

.message.assistant .message-bubble {
  background: var(--ai-bubble);
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
  color: var(--text-primary);
}

.message.user .message-bubble {
  background: var(--user-bubble);
  border: 1px solid #2a4a6e;
  border-top-right-radius: 4px;
  color: var(--text-primary);
}

.message-bubble p { margin-bottom: 6px; }
.message-bubble p:last-child { margin-bottom: 0; }
.message-bubble ul { padding-left: 18px; margin: 6px 0; }
.message-bubble li { margin-bottom: 3px; }

.message-bubble strong {
  color: var(--text-primary);
  font-weight: 600;
}

.message-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  padding: 0 4px;
  text-align: right;
}

.message.assistant .message-time { text-align: left; }

/* タイピングインジケータ */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: var(--ai-bubble);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-top-left-radius: 4px;
  width: fit-content;
}

.typing-dot {
  width: 7px;
  height: 7px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.2s 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.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ===== 入力エリア ===== */
.chat-input-area {
  padding: 14px 20px 16px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.input-wrapper {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  transition: border-color 0.2s;
}

.input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

#chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  max-height: 120px;
  overflow-y: auto;
}

#chat-input::placeholder { color: var(--text-muted); }

.btn-send {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  transition: all 0.15s;
  flex-shrink: 0;
}

.btn-send:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

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

/* ===== ボタン共通 ===== */
.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 15px;
  transition: all 0.15s;
}

.btn-icon:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.btn-add {
  width: 100%;
  padding: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font);
  transition: all 0.15s;
}

.btn-add:hover {
  background: var(--border);
  color: var(--text-primary);
}

/* ===== モーダル ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 480px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

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

.modal-header h3 {
  font-size: 15px;
  font-weight: 600;
}

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

.modal-close {
  font-size: 16px;
}

/* ===== 進捗エントリ ===== */
.progress-entry {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
  border-left: 3px solid var(--accent);
}

.progress-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.progress-content {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===== タスクステータスバッジ ===== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.status-badge.pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.status-badge.done {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

/* ===== ローディング ===== */
.loading {
  text-align: center;
  padding: 12px;
  color: var(--text-muted);
  font-size: 12px;
}

/* ===== モバイルメニューボタン ===== */
.btn-menu {
  display: none;
  font-size: 20px;
  padding: 4px 8px;
}

/* ===== パネルオーバーレイ（モバイル） ===== */
.panel-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 40;
  backdrop-filter: blur(2px);
}

.panel-overlay.active {
  display: block;
}

/* ===== レスポンシブ ===== */
@media (max-width: 768px) {
  .btn-menu {
    display: flex;
  }

  .task-panel {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 80vw;
    max-width: 320px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
  }

  .task-panel.open {
    transform: translateX(0);
  }

  .chat-messages {
    padding: 12px;
  }

  /* ヘッダーを2行に */
  .app-header {
    flex-wrap: wrap;
    height: auto;
    padding: 8px 12px;
    gap: 6px;
  }

  .header-left {
    flex: 1;
  }

  .header-right {
    width: 100%;
    justify-content: flex-end;
    font-size: 12px;
    gap: 8px;
  }

  .workspace-switcher {
    flex: 1;
  }

  #workspace-select {
    max-width: none;
    width: 100%;
    font-size: 12px;
  }

  #today-date {
    display: none;
  }
}

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

.message {
  animation: fadeIn 0.2s ease-out;
}

/* ===== タスクパネルスクロール ===== */
.task-panel > * {
  flex-shrink: 0;
}

.task-panel {
  overflow-y: auto;
}

.task-list {
  max-height: none;
}
