/* === CSS Custom Properties === */
:root {
  --color-primary: #4DC0B5;
  --color-primary-hover: #3dafa4;
  --color-primary-light: rgba(77,192,181,0.15);
  --color-danger: #dc2626;
  --color-text: #333;
  --color-text-secondary: #888;
  --color-text-muted: #bbb;
  --color-border: #e0e0e0;
  --color-bg: #f5f5f5;
  --color-card: #fff;
  /* chrome = サイドバー＋上部バー。白基調（CS眼科は黒を使わない方針。既定も白に統一） */
  --color-sidebar: #ffffff;
  --color-chrome-text: #55696a;
  --color-chrome-strong: #2d3b3a;
  --color-chrome-muted: #93a3a2;
  --color-chrome-hover: rgba(0,0,0,0.05);
  --color-chrome-border: #e7edec;
  --color-chrome-field: #eef3f2;
  --color-chrome-field-focus: #e6efee;
  --color-accent: #e8b93c;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* === リセット・ベース === */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; font-family: 'Inter', 'Noto Sans JP', -apple-system, sans-serif; font-size: 14px; color: var(--color-text); background: var(--color-bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }

/* === ローディング === */
#loading-screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: var(--color-card); z-index: 9999;
}
.loading-content { text-align: center; }
.loading-logo { width: 80px; height: 80px; object-fit: contain; margin-bottom: 24px; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.7; transform: scale(0.95); } }
.loading-spinner {
  width: 36px; height: 36px; margin: 0 auto 16px;
  border: 3px solid var(--color-border); border-top-color: var(--color-primary);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: #999; font-size: 13px; letter-spacing: 0.5px; }

/* === レイアウト === */
#app { display: flex; height: 100vh; }

/* === サイドバー === */
#sidebar {
  width: 240px; min-width: 240px; background: var(--color-sidebar);
  color: var(--color-chrome-text); display: flex; flex-direction: column;
  border-right: 1px solid var(--color-chrome-border);
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
}
#sidebar.collapsed { margin-left: -240px; }

.sidebar-header { padding: 16px 16px 12px; border-bottom: 1px solid var(--color-chrome-border); }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-img { width: 36px; height: 36px; object-fit: contain; border-radius: 6px; }
.logo-text { display: flex; flex-direction: column; }
.logo-title { font-size: 15px; font-weight: 700; color: var(--color-chrome-strong); letter-spacing: -0.2px; line-height: 1.2; }
.logo-subtitle { font-size: 10px; color: var(--color-primary); font-weight: 500; letter-spacing: 1px; text-transform: uppercase; }

.sidebar-search {
  padding: 8px 12px; position: relative;
}
.sidebar-search .search-icon {
  position: absolute; left: 22px; top: 17px;
  font-size: 16px; color: var(--color-chrome-muted); pointer-events: none;
}
.sidebar-search input {
  width: 100%; padding: 7px 10px 7px 34px; background: var(--color-chrome-field);
  border: 1px solid transparent; border-radius: 6px;
  color: var(--color-chrome-strong); font-size: 12px; outline: none; transition: all 0.2s;
}
.sidebar-search input::placeholder { color: var(--color-chrome-muted); }
.sidebar-search input:focus { background: var(--color-chrome-field-focus); border-color: var(--color-primary); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 0; }
.nav-section { padding: 0 8px; }
.nav-section-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10px; text-transform: uppercase; color: var(--color-chrome-muted);
  padding: 10px 8px 4px; letter-spacing: 1px; font-weight: 600;
}
.nav-section-count {
  background: var(--color-primary-light); color: var(--color-primary); padding: 1px 6px;
  border-radius: 8px; font-size: 10px; font-weight: 700;
}
.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 6px; cursor: pointer;
  transition: all 0.15s; font-size: 13px; font-weight: 500;
  margin-bottom: 1px;
}
.nav-item:hover { background: var(--color-chrome-hover); color: var(--color-chrome-strong); }
.nav-item.active { background: var(--color-primary-light); color: var(--color-chrome-strong); }
.nav-item .project-dot {
  width: 10px; height: 10px; border-radius: 4px; flex-shrink: 0;
}
.nav-item .project-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .project-task-count {
  font-size: 11px; color: var(--color-chrome-muted); font-weight: 400;
}
.nav-item .delete-project-btn {
  opacity: 0; color: #e74c3c; font-size: 16px; transition: opacity 0.15s;
  padding: 2px; border-radius: 4px;
}
.nav-item:hover .delete-project-btn { opacity: 0.5; }
.nav-item .delete-project-btn:hover { opacity: 1; background: rgba(231,76,60,0.1); }

/* お気に入りセクション */
.favorites-section {
  padding: 0 8px; margin-bottom: 4px;
}
.favorites-section .nav-section-title {
  color: var(--color-accent); font-size: 10px;
}
.favorites-section .nav-item {
  font-size: 12px; padding: 6px 10px;
}

.nav-add-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px; color: var(--color-chrome-muted); font-size: 12px; font-weight: 500;
  border-radius: 6px; width: 100%; transition: all 0.15s;
}
.nav-add-btn:hover { background: var(--color-chrome-hover); color: var(--color-chrome-strong); }
.nav-add-btn .material-icons-round { font-size: 18px; }

.sidebar-footer {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-top: 1px solid var(--color-chrome-border);
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--color-primary); color: #fff;
  font-size: 13px; font-weight: 700; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.user-info-text { flex: 1; min-width: 0; }
.user-name { font-size: 12px; font-weight: 600; color: var(--color-chrome-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 10px; color: var(--color-chrome-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* === メインコンテンツ === */
#main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* === ヘッダー === */
#main-header {
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; background: var(--color-card);
  border-bottom: 1px solid var(--color-border); min-height: 48px;
}
.header-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hamburger-btn {
  color: #666; padding: 6px; border-radius: 6px;
  transition: all 0.15s; display: flex;
}
.hamburger-btn:hover { background: #f0f0f0; color: var(--color-text); }
.header-project-info { min-width: 0; }
#current-project-name {
  font-size: 15px; font-weight: 700; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; color: var(--color-text); line-height: 1.3;
}
.header-project-desc {
  font-size: 11px; color: #999; display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.header-center { flex: 1; display: flex; justify-content: center; }
.header-tabs {
  display: flex; gap: 0; height: 48px;
}
.tab-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 0 16px; border-radius: 0; color: var(--color-text-secondary);
  font-size: 13px; font-weight: 500; transition: all 0.2s;
  border-bottom: 3px solid transparent; height: 100%;
}
.tab-btn:hover { color: #555; }
.tab-btn.active {
  color: var(--color-text); border-bottom-color: var(--color-primary);
  font-weight: 600; background: transparent; box-shadow: none;
}
.tab-btn .material-icons-round { font-size: 18px; }
.header-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.header-search { display: flex; align-items: center; gap: 6px; }
.header-filter {
  padding: 5px 10px; border: 1px solid #ddd; border-radius: 6px;
  font-size: 12px; color: #555; background: var(--color-card); cursor: pointer;
  outline: none; transition: border-color 0.15s;
}
.header-filter:focus { border-color: var(--color-primary); }

/* フィルターバッジ */
.filter-badge {
  position: absolute; top: -4px; right: -4px;
  background: #EF4444; color: #fff; font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; line-height: 1;
}

/* フィルターパネル */
.filter-panel {
  position: absolute; top: 44px; right: 0;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12); z-index: 100;
  min-width: 680px; max-width: 820px;
}
.filter-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid #f0f0f0;
}
.filter-panel-title {
  font-size: 13px; font-weight: 600; color: #333;
}
.filter-reset-btn {
  font-size: 12px; color: #6B7280; background: none; border: none; cursor: pointer;
  padding: 4px 10px; border-radius: 4px; transition: background 0.15s;
}
.filter-reset-btn:hover { background: #f3f4f6; color: #374151; }

.filter-panel-body {
  display: flex; padding: 8px 0; max-height: 320px;
}
.filter-panel-col {
  flex: 1; min-width: 120px; border-right: 1px solid #f0f0f0;
  padding: 0 4px; display: flex; flex-direction: column;
}
.filter-panel-col:last-child { border-right: none; }
.filter-col-title {
  font-size: 11px; font-weight: 600; color: #9CA3AF; text-transform: uppercase;
  letter-spacing: 0.3px; padding: 4px 12px 6px; flex-shrink: 0;
}
.filter-col-items {
  overflow-y: auto; flex: 1;
}
.filter-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; cursor: pointer; border-radius: 6px;
  margin: 1px 4px; transition: background 0.12s; font-size: 13px; color: #374151;
  user-select: none;
}
.filter-item:hover { background: #f3f4f6; }
.filter-item.active { background: #EBF5FF; color: #2563EB; }
.filter-item .filter-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.filter-item .filter-check {
  width: 16px; height: 16px; border: 2px solid #d1d5db; border-radius: 4px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-size: 11px; color: transparent; transition: all 0.12s;
}
.filter-item.active .filter-check {
  background: #2563EB; border-color: #2563EB; color: #fff;
}
.filter-item .filter-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: #e5e7eb; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: #6B7280; flex-shrink: 0;
}
.filter-item-label { flex: 1; white-space: nowrap; font-size: 13px; }
.header-search .material-icons-round { font-size: 18px; color: #999; }

/* Jooto風ヘッダーアクションボタン */
.header-action-btn {
  display: flex; align-items: center; gap: 4px; position: relative;
  padding: 5px 12px; border-radius: 6px; font-size: 12px;
  font-weight: 500; color: #666; background: var(--color-bg);
  border: 1px solid var(--color-border); transition: all 0.15s;
}
.header-action-btn:hover { background: #eee; color: var(--color-text); }
.header-action-btn.active { background: #e8f7f5; color: var(--color-primary); border-color: var(--color-primary); }
.header-action-btn .material-icons-round { font-size: 16px; }

.icon-btn {
  padding: 6px; border-radius: 6px; color: var(--color-text-secondary);
  transition: all 0.15s; display: flex;
}
.icon-btn:hover { background: #f0f0f0; color: #555; }

/* === Welcome画面 === */
#welcome-view {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: var(--color-bg);
}
.welcome-content { text-align: center; max-width: 420px; padding: 40px; }
.welcome-logo {
  width: 100px; height: 100px; object-fit: contain;
  margin-bottom: 24px; opacity: 0.9;
}
.welcome-content h2 {
  font-size: 22px; font-weight: 700; color: var(--color-text); margin-bottom: 8px;
}
.welcome-content p { color: var(--color-text-secondary); margin-bottom: 28px; line-height: 1.6; }

/* === ボタン === */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 6px; font-weight: 600;
  transition: all 0.2s; font-size: 13px;
}
.btn-primary {
  background: var(--color-primary); color: #fff;
  box-shadow: none;
}
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-secondary { background: #f0f0f0; color: #555; }
.btn-secondary:hover { background: #e0e0e0; }
.btn-danger { background: #fee2e2; color: var(--color-danger); }
.btn-danger:hover { background: #fecaca; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-lg { padding: 10px 24px; font-size: 14px; }
.btn-ghost { color: var(--color-text-secondary); padding: 5px 10px; border-radius: 6px; }
.btn-ghost:hover { background: #f0f0f0; color: #555; }

/* === カンバンボード (Jooto風) === */
#kanban-view {
  flex: 1; display: flex; overflow-x: auto; padding: 16px;
  gap: 12px; align-items: flex-start;
  background: var(--color-bg);
}
.kanban-column {
  min-width: 280px; max-width: 280px; background: var(--color-card);
  border-radius: var(--radius-md); display: flex; flex-direction: column;
  max-height: calc(100vh - 100px);
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.kanban-column.drag-over {
  outline: 2px dashed var(--color-primary); outline-offset: -2px;
  background: rgba(77,192,181,0.03);
}

/* Jooto風: カラムヘッダー上部にカラーバー */
.column-color-bar {
  height: 6px; border-radius: 8px 8px 0 0;
}
.column-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px 8px;
}
.column-header-left { display: flex; align-items: center; gap: 6px; }
.column-title { font-weight: 700; font-size: 13px; color: var(--color-text); }
.column-count {
  color: #e74c3c; font-size: 12px; font-weight: 700;
  padding: 0; background: none;
}
.column-header-actions { display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s; }
.kanban-column:hover .column-header-actions { opacity: 1; }
.column-header-actions button {
  padding: 3px; border-radius: var(--radius-sm); color: var(--color-text-muted);
  transition: all 0.15s; display: flex;
}
.column-header-actions button:hover { background: #f0f0f0; color: #666; }

/* Jooto風: カラム上部の「+タスクを追加」ボタン */
.column-top-add {
  padding: 4px 12px 4px;
}
.column-top-add-btn {
  display: flex; align-items: center; gap: 4px;
  width: 100%; padding: 6px 10px; color: var(--color-primary);
  border: none; border-radius: 6px;
  font-size: 12px; font-weight: 600; transition: all 0.15s;
  background: #fff; justify-content: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.column-top-add-btn:hover { background: #f0faf9; box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
.column-top-add-btn .material-icons-round { font-size: 16px; }

.column-body { flex: 1; overflow-y: auto; padding: 4px 8px 8px; min-height: 60px; }
.column-footer { padding: 6px 8px; border-top: 1px solid #f0f0f0; }
.add-task-btn {
  display: flex; align-items: center; gap: 4px;
  width: 100%; padding: 6px 8px; color: var(--color-text-muted);
  border-radius: var(--radius-sm); font-size: 12px; font-weight: 500; transition: all 0.15s;
}
.add-task-btn:hover { background: var(--color-bg); color: #999; }

/* === タスクカード (Jooto風) === */
.task-card {
  background: var(--color-card); border-radius: var(--radius-md); padding: 10px 12px;
  margin-bottom: 6px; cursor: pointer;
  transition: all 0.15s;
  border: 1px solid #e8e8e8;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  position: relative;
}
.task-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  border-color: #ccc;
}
.task-card.dragging { opacity: 0.4; transform: rotate(2deg) scale(0.98); }

/* Jooto風: カード上部 */
.task-card-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.task-card-number { font-size: 11px; color: var(--color-text-muted); font-weight: 500; }
.task-card-menu {
  padding: 2px; border-radius: var(--radius-sm); color: #ccc;
  transition: all 0.15s; opacity: 0; display: flex;
}
.task-card:hover .task-card-menu { opacity: 1; }
.task-card-menu:hover { background: #f0f0f0; color: var(--color-text-secondary); }
.task-card-menu .material-icons-round { font-size: 18px; }
.task-card-actions { display: flex; align-items: center; gap: 4px; }
.task-star { display: flex; align-items: center; justify-content: center; padding: 2px; color: var(--color-text-muted); border-radius: var(--radius-sm); touch-action: manipulation; }
.task-star .material-icons-round { font-size: 18px; }
.task-star[aria-pressed="true"] { color: #e8b93c; }
.task-star:hover { background: var(--color-bg); }
.task-star:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.task-star:disabled { opacity: 0.5; }

/* Jooto風: チェック + タイトル */
.task-card-title-row { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 4px; }
.task-check { color: #d0d5dd; display: flex; flex-shrink: 0; margin-top: 1px; }
.task-check .material-icons-round { font-size: 18px; }
.task-check.done { color: #10b981; }

.task-card-labels { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 6px; padding-left: 24px; }
.task-label {
  padding: 1px 8px; border-radius: 3px; font-size: 10px;
  font-weight: 600; color: #fff; letter-spacing: 0.2px;
}
.task-label::before { content: "\2713 "; font-weight: 700; }

.task-card-title {
  font-size: 13px; font-weight: 500; line-height: 1.5; color: var(--color-text);
}
.task-card-title.done { text-decoration: line-through; color: #999; }

/* Jooto風: メタ情報 */
.task-card-meta {
  display: flex; align-items: center; gap: 8px; font-size: 11px; color: #999;
  flex-wrap: wrap;
}
.task-meta-badge {
  display: flex; align-items: center; gap: 2px; font-weight: 500;
}
.task-meta-badge .material-icons-round { font-size: 14px; }

/* Jooto風: 日付範囲表示 */
.task-date-range {
  display: flex; align-items: center; gap: 3px;
  font-size: 11px; color: var(--color-text-secondary); font-weight: 500;
  padding: 2px 0 2px 24px;
}
.task-date-range.overdue { color: var(--color-danger); font-weight: 600; }

.task-priority-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.priority-high { background: var(--color-danger); }
.priority-medium { background: #f59e0b; }
.priority-low { background: #10b981; }

.task-card-bottom {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--color-bg);
}
.task-assignee-badge {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--color-primary); color: #fff;
  font-size: 11px; display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.task-assignee-group { display: flex; margin-left: auto; }
.task-assignee-group .task-assignee-badge {
  margin-left: -6px; border: 2px solid var(--color-card);
}
.task-assignee-group .task-assignee-badge:first-child { margin-left: 0; }
.task-assignee-badge.has-photo { padding: 0; overflow: hidden; background: none; }
.task-assignee-badge.has-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

.task-checklist-badge {
  display: flex; align-items: center; gap: 2px;
  font-size: 11px; color: var(--color-text-secondary);
}
.task-checklist-badge .material-icons-round { font-size: 14px; }
.task-checklist-badge.all-done { color: #10b981; }

/* === ポップアップメニュー (Jooto風) === */
.popup-overlay {
  position: fixed; inset: 0; z-index: 1000;
}
.popup-menu {
  position: fixed; background: var(--color-card); border-radius: var(--radius-md);
  box-shadow: 0 4px 24px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.05);
  min-width: 200px; padding: 4px 0; z-index: 1001;
  animation: popupIn 0.15s ease;
}
@keyframes popupIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.popup-menu-header {
  padding: 10px 16px 8px; font-size: 12px; font-weight: 700; color: var(--color-text);
  border-bottom: 1px solid #f0f0f0; margin-bottom: 2px;
}
.popup-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; font-size: 13px; color: #555; cursor: pointer;
  transition: background 0.1s;
}
.popup-menu-item:hover { background: var(--color-bg); }
.popup-menu-item .material-icons-round { font-size: 18px; color: #999; }
.popup-menu-item.danger { color: var(--color-danger); }
.popup-menu-item.danger .material-icons-round { color: var(--color-danger); }
.popup-menu-item.danger:hover { background: #fef2f2; }
.popup-menu-divider { height: 1px; background: #f0f0f0; margin: 4px 0; }

/* カラムヘッダーのメニューボタン */
.column-menu-btn {
  padding: 2px; border-radius: var(--radius-sm); color: var(--color-text-muted);
  transition: all 0.15s; display: flex;
}
.column-menu-btn:hover { background: #f0f0f0; color: #666; }

/* === カラム追加 === */
.add-column-btn {
  min-width: 280px; display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 16px; color: var(--color-text-muted); background: rgba(0,0,0,0.02);
  border-radius: var(--radius-sm); border: 2px dashed #ddd;
  font-size: 13px; font-weight: 500; transition: all 0.2s; height: fit-content;
}
.add-column-btn:hover { background: rgba(77,192,181,0.04); color: var(--color-primary); border-color: var(--color-primary); }

/* === モーダル (Jooto風: 右寄りオーバーレイ) === */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3);
  display: flex; align-items: stretch; justify-content: flex-end;
  z-index: 1000; animation: fadeIn 0.2s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
  background: var(--color-card); width: 600px; max-width: 90%;
  overflow-y: auto; animation: slideInRight 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
  border-radius: 0;
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
/* 新規プロジェクト等のセンターモーダル */
.modal-content.modal-center {
  align-self: center; margin-right: auto; margin-left: auto;
  border-radius: var(--radius-lg); width: 500px; max-height: 90vh;
  animation: modalIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid #eee;
}
.modal-header h3 { font-size: 16px; font-weight: 700; color: var(--color-text); }
.modal-body { padding: 20px; }
/* Jooto風タスクモーダルのフィールド行 */
.jooto-field-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; cursor: pointer; transition: background 0.15s;
  border-bottom: 1px solid #f5f5f5;
}
.jooto-field-row:hover { background: #f9f9f9; }
.jooto-field-icon {
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: #888;
}
.jooto-field-icon .material-icons-round { font-size: 20px; }
.jooto-field-content {
  flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0;
}
.jooto-field-label {
  font-size: 11px; color: #999; font-weight: 500;
}
.jooto-field-value {
  font-size: 13px; color: #333; font-weight: 500;
}
.jooto-field-placeholder {
  color: #ccc; font-weight: 400;
}
.jooto-field-arrow {
  font-size: 18px; color: #ccc; flex-shrink: 0;
  transition: transform 0.2s;
}
.jooto-field-expand {
  background: #fafafa; border-bottom: 1px solid #f0f0f0;
}
.jooto-task-title {
  font-size: 20px; font-weight: 700; color: #333;
  border: none; background: none; width: 100%; padding: 16px 20px 8px;
  outline: none; resize: none; line-height: 1.4;
}
.jooto-task-title:focus { background: #f8f8f8; border-radius: 6px; }
.jooto-desc-area {
  padding: 0 20px 12px; font-size: 13px; color: #666;
}
.jooto-desc-area textarea {
  width: 100%; min-height: 60px; border: 1px solid #e5e7eb; border-radius: 6px;
  padding: 8px; font-size: 13px; resize: vertical; outline: none;
}
.jooto-desc-area textarea:focus { border-color: #4DC0B5; }
.jooto-topbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-bottom: 1px solid #eee;
  font-size: 12px; color: #999;
}
.jooto-topbar-right {
  display: flex; align-items: center; gap: 4px; margin-left: auto;
}

.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 20px; border-top: 1px solid #eee;
}

/* === タスク詳細モーダル (Jooto風) === */
.task-detail-top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-bottom: 1px solid #eee; background: #fafafa;
}
.task-detail-top-left {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--color-text-secondary);
}
.task-detail-top-right {
  display: flex; align-items: center; gap: 6px;
}
.task-status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-sm); font-size: 11px;
  font-weight: 700; background: transparent; border: 1.5px solid;
}
.task-status-badge.status-todo { color: #e74c3c; border-color: #e74c3c; }
.task-status-badge.status-doing { color: #3498db; border-color: #3498db; }
.task-status-badge.status-done { color: #2ecc71; border-color: #2ecc71; }

.task-detail-header {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 16px 20px 12px;
}
.task-detail-title {
  flex: 1; font-size: 18px; font-weight: 700; border: none;
  outline: none; padding: 2px 0; width: 100%; color: var(--color-text);
  border-bottom: 2px solid transparent; transition: border-color 0.2s;
}
.task-detail-title:focus { border-bottom-color: var(--color-primary); }
.task-detail-body { padding: 0 20px 20px; }
.task-detail-section { margin-bottom: 20px; }
.task-detail-section-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: #666; margin-bottom: 10px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.task-detail-section-title .material-icons-round { font-size: 16px; color: var(--color-primary); }

/* === Task field rows (Jooto style) === */
.task-field-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid #f5f5f5;
  cursor: pointer; transition: background 0.15s; border-radius: 4px;
}
.task-field-row:hover { background: #f8f8f8; }
.task-field-icon { color: #999; display: flex; flex-shrink: 0; }
.task-field-icon .material-icons-round { font-size: 20px; }
.task-field-label { font-size: 13px; color: #888; flex: 1; }
.task-field-value { font-size: 13px; color: #333; font-weight: 500; }
.task-field-row.has-value .task-field-label { color: #333; }

/* === Description click-to-edit === */
.task-desc-placeholder {
  font-size: 13px; color: var(--color-text-muted); cursor: pointer; padding: 8px 0;
  transition: color 0.15s;
}
.task-desc-placeholder:hover { color: var(--color-text-secondary); }
.task-desc-editing { display: block; }

/* フォーム */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--color-text-secondary); margin-bottom: 4px; letter-spacing: 0.2px;
}
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 8px 12px; border: 1px solid #ddd;
  border-radius: var(--radius-sm); font-size: 13px; transition: all 0.2s;
  background: var(--color-card); color: var(--color-text);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none; border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-light);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* Jooto風日付範囲 */
.date-range-display {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; background: #f8f8f8; border-radius: var(--radius-sm);
  font-size: 13px; color: #555;
}
.date-range-display .material-icons-round { font-size: 16px; color: #999; }
.date-range-separator { color: #ccc; }

/* チェックリスト */
.checklist-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 6px; border-radius: var(--radius-sm); font-size: 13px;
  transition: background 0.15s;
}
.checklist-item:hover { background: #f8f8f8; }
.checklist-item input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--color-primary); border-radius: 3px;
}
.checklist-item.done span { text-decoration: line-through; color: var(--color-text-muted); }
.checklist-item .delete-cl-btn {
  margin-left: auto; opacity: 0; color: #ddd; padding: 3px;
  border-radius: var(--radius-sm); display: flex; transition: all 0.15s;
}
.checklist-item:hover .delete-cl-btn { opacity: 1; }
.checklist-item .delete-cl-btn:hover { color: var(--color-danger); background: #fee2e2; }
.checklist-progress {
  height: 4px; background: #eee; border-radius: 2px; margin-bottom: 10px;
  overflow: hidden;
}
.checklist-progress-bar {
  height: 100%; background: var(--color-primary);
  border-radius: 2px; transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.add-checklist-input { display: flex; gap: 6px; margin-top: 8px; }
.add-checklist-input input {
  flex: 1; padding: 6px 10px; border: 1px solid #ddd;
  border-radius: var(--radius-sm); font-size: 12px;
}

/* コメント */
.comment-item {
  display: flex; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}
.comment-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--color-primary); color: #fff;
  font-size: 12px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0;
}
.comment-body { flex: 1; }
.comment-meta { font-size: 11px; color: #999; margin-bottom: 3px; font-weight: 500; }
.comment-text { font-size: 13px; line-height: 1.5; color: #555; }
.add-comment-area { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.add-comment-area textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #ddd;
  border-radius: var(--radius-sm); resize: none; min-height: 80px; font-size: 13px;
}
.add-comment-area .btn { align-self: flex-end; }

/* ラベルピッカー */
.label-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.label-picker-item {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: var(--radius-sm); font-size: 11px;
  font-weight: 600; color: #fff; cursor: pointer;
  opacity: 0.4; transition: all 0.2s;
}
.label-picker-item:hover { opacity: 0.65; }
.label-picker-item.selected { opacity: 1; }

/* === ガントチャート === */
#gantt-view { flex: 1; overflow: auto; padding: 16px; background: var(--color-bg); }
.gantt-container { min-width: 100%; }
.gantt-header-bar {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.gantt-header-bar h3 { font-size: 16px; font-weight: 700; color: var(--color-text); }
.gantt-controls { display: flex; gap: 4px; background: #f0f0f0; border-radius: 6px; padding: 2px; }
.gantt-cell {
  padding: 8px 0; border-bottom: 1px solid #f0f0f0;
  display: flex; align-items: center; font-size: 12px;
}
.gantt-cell-header {
  background: #f8f8f8; font-weight: 700; font-size: 11px;
  color: var(--color-text-secondary); position: sticky; top: 0; z-index: 2;
}
.gantt-task-name {
  min-width: 220px; max-width: 220px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; padding-left: 10px;
  border-right: 1px solid var(--color-border); font-weight: 500;
  box-sizing: border-box;
}
.gantt-bar {
  position: absolute; height: 22px; border-radius: var(--radius-sm);
  top: 50%; transform: translateY(-50%);
  cursor: pointer; transition: all 0.2s;
  min-width: 6px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.gantt-bar:hover { transform: translateY(-50%) scale(1.02); box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
.gantt-bar-label {
  padding: 0 8px; color: #fff; font-size: 10px; font-weight: 600;
  line-height: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gantt-today-marker { background: var(--color-danger); width: 2px; z-index: 1; }
.gantt-date-cell {
  text-align: center; font-size: 10px; color: #999; padding: 2px 0;
  border-right: 1px solid #f0f0f0; font-weight: 500; line-height: 1.3;
  box-sizing: border-box;
}
.gantt-date-cell .gantt-day-num { display: block; font-size: 11px; font-weight: 600; }
.gantt-date-cell .gantt-day-week { display: block; font-size: 9px; font-weight: 400; color: #bbb; }
.gantt-date-cell.weekend { background: #fdf6f6; }
.gantt-date-cell.weekend .gantt-day-week { color: #e8a0a0; }
.gantt-date-cell.today { font-weight: 700; position: relative; }
.gantt-date-cell.today .gantt-day-num {
  background: var(--color-danger); color: #fff; border-radius: 50%;
  width: 22px; height: 22px; line-height: 22px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
}
.gantt-date-cell.today .gantt-day-week { color: var(--color-danger); }
.gantt-today-line {
  position: absolute; top: 0; bottom: 0; z-index: 2;
  background: rgba(220, 38, 38, 0.08);
  pointer-events: none;
}
.gantt-empty {
  padding: 40px; text-align: center; color: #999; font-size: 13px;
  background: var(--color-card); border-radius: var(--radius-sm); border: 1px solid var(--color-border);
}

/* === ダッシュボード (Jooto風) === */
#dashboard-view {
  flex: 1; overflow-y: auto; padding: 20px; background: var(--color-bg);
}

/* Jooto風ダッシュボードセクション */
.dashboard-welcome {
  background: var(--color-card); border-radius: var(--radius-md); padding: 20px;
  margin-bottom: 16px; border: 1px solid var(--color-border);
}
.dashboard-welcome h2 {
  font-size: 16px; font-weight: 700; color: var(--color-text); margin-bottom: 4px;
}
.dashboard-welcome p { font-size: 13px; color: var(--color-text-secondary); }

.dashboard-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px;
}
.dashboard-section-card {
  background: var(--color-card); border-radius: var(--radius-md); border: 1px solid var(--color-border);
  overflow: hidden;
}
.dashboard-section-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid #f0f0f0;
  background: #fafafa;
}
.dashboard-section-card-header h3 {
  font-size: 14px; font-weight: 700; color: var(--color-text);
  display: flex; align-items: center; gap: 6px;
}
.dashboard-section-card-header h3 .material-icons-round { font-size: 18px; color: var(--color-primary); }
.dashboard-section-card-body {
  padding: 12px 16px; min-height: 80px;
}

/* タスクタブ (期限切れ / 期限間近 / 進行中 / 開始間近) */
.dashboard-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--color-border); padding: 0 16px;
  background: #fafafa;
}
.dashboard-tab {
  padding: 8px 14px; font-size: 12px; font-weight: 600; color: #999;
  border-bottom: 2px solid transparent; cursor: pointer;
  transition: all 0.15s;
}
.dashboard-tab:hover { color: #666; }
.dashboard-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.dashboard-tab .tab-count {
  background: #e74c3c; color: #fff; font-size: 10px;
  padding: 1px 5px; border-radius: 8px; margin-left: 4px; font-weight: 700;
}
.dashboard-tab.active .tab-count { background: var(--color-primary); }

.dashboard-task-list { padding: 0; }
.dashboard-task-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid var(--color-bg);
  cursor: pointer; transition: background 0.15s; font-size: 13px;
}
.dashboard-task-item:hover { background: #f8f8f8; }
.dashboard-task-item:last-child { border-bottom: none; }
.dashboard-task-item .task-priority-dot { flex-shrink: 0; }
.dashboard-task-item-title { flex: 1; font-weight: 500; color: var(--color-text); }
.dashboard-task-item-date { font-size: 11px; color: #999; }
.dashboard-task-item-date.overdue { color: #e74c3c; font-weight: 600; }
.dashboard-task-item-project {
  font-size: 10px; color: #aaa; background: #f0f0f0;
  padding: 1px 6px; border-radius: 3px;
}

/* Jooto風統計カード (小) */
.dashboard-stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-bottom: 16px;
}
.dashboard-stat-mini {
  background: var(--color-card); border-radius: var(--radius-md); padding: 14px 16px;
  border: 1px solid var(--color-border); text-align: center;
}
.dashboard-stat-mini-value {
  font-size: 28px; font-weight: 700; color: var(--color-text); line-height: 1.2;
}
.dashboard-stat-mini-label {
  font-size: 11px; color: #999; margin-top: 2px;
}

.dashboard-empty {
  text-align: center; padding: 30px; color: #ccc; font-size: 13px;
}

/* 旧ダッシュボード互換 */
.dashboard-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.stat-card {
  background: var(--color-card); border-radius: var(--radius-md); padding: 16px;
  border: 1px solid var(--color-border); transition: all 0.2s;
}
.stat-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.stat-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.stat-card-icon {
  width: 36px; height: 36px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
}
.stat-card-icon .material-icons-round { font-size: 20px; color: #fff; }
.stat-card-label { font-size: 11px; color: var(--color-text-secondary); font-weight: 600; }
.stat-card-value { font-size: 28px; font-weight: 700; color: var(--color-text); line-height: 1.2; }
.stat-card-sub { font-size: 11px; color: #999; margin-top: 2px; }

.dashboard-section { margin-bottom: 16px; }
.dashboard-section-title { font-size: 14px; font-weight: 700; color: var(--color-text); margin-bottom: 10px; }
.progress-chart {
  background: var(--color-card); border-radius: var(--radius-md); padding: 16px;
  border: 1px solid var(--color-border);
}
.progress-bar-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.progress-bar-label { min-width: 90px; font-size: 12px; font-weight: 500; color: #555; }
.progress-bar-track { flex: 1; height: 8px; background: #f0f0f0; border-radius: var(--radius-sm); overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: var(--radius-sm); transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.progress-bar-value { min-width: 36px; text-align: right; font-size: 12px; font-weight: 600; color: var(--color-text-secondary); }

.overdue-list { background: var(--color-card); border-radius: var(--radius-md); padding: 12px; border: 1px solid var(--color-border); }
.overdue-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 6px;
  border-bottom: 1px solid #f8f8f8; cursor: pointer; border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.overdue-item:hover { background: #fef2f2; }
.overdue-item:last-child { border-bottom: none; }

/* === プロジェクトリスト === */
#project-list-view {
  flex: 1; overflow-y: auto; padding: 20px;
  background: var(--color-bg); flex-direction: column;
}
.pl-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.pl-header-left { display: flex; align-items: center; gap: 10px; }
.pl-title { font-size: 18px; font-weight: 700; color: var(--color-text); }
.pl-count {
  background: var(--color-primary-light); color: var(--color-primary);
  padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700;
}
.pl-header-right { display: flex; align-items: center; gap: 10px; }
.pl-search {
  display: flex; align-items: center; gap: 6px;
  background: var(--color-card); border: 1px solid #ddd; border-radius: 6px;
  padding: 6px 12px; transition: border-color 0.2s; min-width: 220px;
}
.pl-search:focus-within { border-color: var(--color-primary); }
.pl-search-input {
  border: none; outline: none; font-size: 13px; color: var(--color-text);
  background: transparent; flex: 1; min-width: 0;
}
.pl-search-input::placeholder { color: var(--color-text-muted); }

.pl-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px; align-content: start;
}
.pl-card {
  background: var(--color-card); border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--color-border); cursor: pointer;
  transition: all 0.2s;
}
.pl-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08); transform: translateY(-2px);
}
.pl-card-active { border-color: var(--color-primary); }
.pl-card-color { height: 4px; }
.pl-card-body { padding: 14px 16px 12px; }
.pl-card-name { font-size: 15px; font-weight: 700; color: var(--color-text); margin-bottom: 4px; }
.pl-card-desc {
  font-size: 12px; color: var(--color-text-secondary); line-height: 1.5; margin-bottom: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.pl-card-stats {
  display: flex; align-items: center; gap: 10px; font-size: 11px;
  color: #999; margin-bottom: 10px;
}
.pl-card-stat { display: flex; align-items: center; gap: 3px; font-weight: 500; }
.pl-stat-overdue { color: var(--color-danger); background: #fee2e2; padding: 2px 5px; border-radius: 3px; }
.pl-card-progress { display: flex; align-items: center; gap: 8px; }
.pl-card-progress-track {
  flex: 1; height: 4px; background: #f0f0f0; border-radius: 2px; overflow: hidden;
}
.pl-card-progress-bar {
  height: 100%; border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.pl-card-progress-text { font-size: 11px; font-weight: 700; color: var(--color-text-secondary); min-width: 28px; text-align: right; }

.pl-card-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 140px; border: 2px dashed #ddd; background: transparent;
  box-shadow: none; gap: 6px;
}
.pl-card-add:hover { border-color: var(--color-primary); background: rgba(77,192,181,0.03); }

.pl-empty { text-align: center; padding: 40px 20px; color: var(--color-text-secondary); font-size: 13px; }

/* === カラーピッカー === */
.color-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.color-option {
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: all 0.2s;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}
.color-option:hover { transform: scale(1.15); }
.color-option.selected { border-color: var(--color-text); box-shadow: 0 0 0 2px var(--color-card), 0 0 0 3px var(--color-text); }

/* === アイコンピッカー (Jooto風) === */
.project-icon-preview {
  width: 72px; height: 72px; border-radius: 16px; background: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: background 0.3s;
}
.icon-picker-tabs {
  display: flex; gap: 0; margin-bottom: 10px; border-bottom: 1px solid var(--color-border);
}
.icon-picker-tab {
  padding: 6px 14px; font-size: 12px; font-weight: 600; color: #999;
  border-bottom: 2px solid transparent; cursor: pointer; transition: all 0.15s;
  background: none; border-top: none; border-left: none; border-right: none;
}
.icon-picker-tab:hover { color: #666; }
.icon-picker-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.icon-picker {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 4px 0;
}
.icon-cat-picker { padding: 4px 0; }
.icon-cat-label { font-size: 11px; font-weight: 700; color: #999; margin: 8px 0 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.icon-cat-label:first-child { margin-top: 0; }
.icon-cat-picker .icon-picker { max-height: none; }
.color-picker.mini-picker { gap: 6px; }
.color-option.mini { width: 24px; height: 24px; border-radius: 50%; }
.icon-option {
  width: 36px; height: 36px; border-radius: var(--radius-md); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-bg); border: 2px solid transparent;
  transition: all 0.15s; color: #666;
}
.icon-option:hover { background: #e8f7f5; color: var(--color-primary); }
.icon-option.selected { background: var(--color-primary); color: #fff; border-color: #3aa89d; }
.icon-option .material-icons-round, .icon-option .material-symbols-rounded { font-size: 20px; }
.material-symbols-rounded { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }

/* === Toggle Switch === */
.toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #ccc; border-radius: 22px; transition: 0.2s; }
.toggle-slider::before { content: ''; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.2s; }
.toggle-switch input:checked + .toggle-slider { background: #4DC0B5; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* === Email Template Tabs === */
.email-tpl-tab { padding: 10px 16px; cursor: pointer; border-left: 3px solid transparent; transition: all 0.15s; }
.email-tpl-tab:hover { background: #f8f9fa; }
.email-tpl-tab.active { background: #f0f7ff; border-left-color: var(--color-primary); }
.email-tpl-tab.active div:first-child { color: var(--color-primary); }

/* === トースト === */
#toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 6px;
}
.toast {
  padding: 12px 20px; background: var(--color-text); color: #fff;
  border-radius: 6px; font-size: 13px; font-weight: 500;
  animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  display: flex; align-items: center; gap: 8px;
}
.toast.error { background: var(--color-danger); }
.toast.success { background: #059669; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === インライン編集 === */
.inline-edit-input {
  width: 100%; padding: 4px 8px; border: 2px solid var(--color-primary);
  border-radius: var(--radius-sm); font-size: 13px; background: var(--color-card); font-weight: 700;
}

/* === キーボードショートカットヒント === */
.kbd {
  display: inline-block; padding: 2px 6px; background: #f0f0f0;
  border: 1px solid #ddd; border-radius: 3px; font-size: 11px;
  font-family: monospace; color: var(--color-text-secondary);
}

/* === 音声入力 === */
.voice-mic-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: #f0f0f0; color: var(--color-text-secondary); transition: all 0.2s;
  flex-shrink: 0;
}
.voice-mic-btn:hover { background: #e0e0e0; color: #555; }
.voice-mic-btn.voice-active {
  background: var(--color-danger); color: #fff;
  animation: voicePulse 1s ease-in-out infinite;
}
@keyframes voicePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.4); }
  50% { box-shadow: 0 0 0 10px rgba(220,38,38,0); }
}
#voice-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
}
.voice-modal {
  background: var(--color-card); border-radius: var(--radius-lg); padding: 28px;
  width: 90%; max-width: 440px; text-align: center;
  box-shadow: 0 16px 40px rgba(0,0,0,0.15);
}
.voice-wave {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; height: 36px; margin: 16px 0;
}
.voice-wave-bar {
  width: 4px; border-radius: 2px; background: var(--color-primary);
  animation: waveAnim 0.8s ease-in-out infinite;
}
.voice-wave-bar:nth-child(1) { height: 12px; animation-delay: 0s; }
.voice-wave-bar:nth-child(2) { height: 24px; animation-delay: 0.1s; }
.voice-wave-bar:nth-child(3) { height: 36px; animation-delay: 0.2s; }
.voice-wave-bar:nth-child(4) { height: 24px; animation-delay: 0.3s; }
.voice-wave-bar:nth-child(5) { height: 12px; animation-delay: 0.4s; }
@keyframes waveAnim {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1); }
}
.voice-transcript {
  font-size: 15px; color: var(--color-text); line-height: 1.6;
  min-height: 40px; padding: 10px; background: #f8f8f8;
  border-radius: var(--radius-md); margin-bottom: 16px;
}

/* === Settings View (Jooto style) === */
#settings-view {
  flex: 1; overflow-y: auto; padding: 24px 20px;
  background: var(--color-bg); display: flex; flex-direction: column; align-items: center;
}
.settings-card {
  background: var(--color-card); border-radius: var(--radius-md); border: 1px solid var(--color-border);
  max-width: 700px; width: 100%; margin: 0 auto 16px; padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.settings-card-title {
  font-size: 16px; font-weight: 700; color: var(--color-text); margin-bottom: 16px;
  padding-bottom: 12px; border-bottom: 1px solid #f0f0f0;
}
.settings-project-image {
  margin-bottom: 20px;
}
.settings-image-placeholder {
  width: 120px; height: 120px; border: 2px dashed #ddd; border-radius: var(--radius-md);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; cursor: pointer; transition: all 0.15s;
}
.settings-image-placeholder:hover {
  border-color: var(--color-primary); background: rgba(77,192,181,0.03);
}
.settings-card-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px;
  padding-top: 16px; border-top: 1px solid #f0f0f0;
}
.settings-label-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid #f8f8f8;
}
.settings-label-row:last-child { border-bottom: none; }
.settings-label-dot {
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
}
.settings-label-name-input {
  flex: 1; border: 1px solid transparent; padding: 4px 8px;
  border-radius: var(--radius-sm); font-size: 13px; transition: border-color 0.15s;
  background: transparent;
}
.settings-label-name-input:focus {
  outline: none; border-color: var(--color-primary); background: var(--color-card);
}
.settings-label-color-input {
  width: 28px; height: 28px; border: none; cursor: pointer;
  padding: 0; background: none; border-radius: var(--radius-sm);
}
.settings-add-label {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  padding-top: 12px; border-top: 1px solid #f0f0f0;
}
.settings-danger-zone {
  border-color: #fecaca;
}

/* === Members View (Jooto style) === */
#member-view {
  flex: 1; overflow-y: auto; padding: 24px 20px;
  background: var(--color-bg); display: flex; flex-direction: column; align-items: center;
}
.member-card {
  background: var(--color-card); border-radius: var(--radius-md); border: 1px solid var(--color-border);
  max-width: 800px; width: 100%; margin: 0 auto;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.member-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid #f0f0f0;
}
.member-header-title h3 {
  font-size: 16px; font-weight: 700; color: var(--color-text);
}
.member-list { }
.member-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; border-bottom: 1px solid #f8f8f8;
  transition: background 0.15s;
}
.member-row:last-child { border-bottom: none; }
.member-row:hover { background: #fafafa; }
.member-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--color-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; flex-shrink: 0;
}
.member-info { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.member-invite-form { padding: 16px 20px; border-bottom: 1px solid #f0f0f0; }
.member-invite-fields { display: flex; gap: 8px; }
.member-invite-fields .form-input { flex: 1; min-width: 0; width: 100%; }
.member-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.member-name { font-size: 14px; font-weight: 600; color: var(--color-text); }
.member-email { font-size: 12px; color: #999; }
.member-role {
  font-size: 12px; color: var(--color-text-secondary); background: #f0f0f0;
  padding: 3px 10px; border-radius: var(--radius-sm); white-space: nowrap;
}
.member-role.manager {
  color: var(--color-primary); background: #e8f7f5;
}
.member-sub-info {
  font-size: 11px; color: #4DC0B5; margin-top: 2px;
}
.member-remove-btn {
  opacity: 0; transition: opacity 0.15s;
}
.member-row:hover .member-remove-btn, .member-row:focus-within .member-remove-btn { opacity: 1; }

/* === File View (Jooto style) === */
#file-view {
  flex: 1; overflow-y: auto; background: var(--color-card);
  display: flex; flex-direction: column;
}
.file-header {
  display: flex; align-items: center; padding: 8px 16px;
  border-bottom: 1px solid var(--color-border); gap: 12px;
}
.file-table { width: 100%; border-collapse: collapse; }
.file-table th {
  text-align: left; padding: 10px 16px; font-size: 12px;
  color: var(--color-text-secondary); font-weight: 600; border-bottom: 1px solid var(--color-border);
  background: #fafafa;
}
.file-table td {
  padding: 10px 16px; border-bottom: 1px solid var(--color-bg); font-size: 13px;
}
.file-empty-state {
  padding: 60px 20px; text-align: center;
}

/* === Global Nav Bar (Header 2-row layout) === */
.global-nav {
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px; background: var(--color-sidebar);
  min-height: 40px; color: var(--color-chrome-text);
  border-bottom: 1px solid var(--color-chrome-border);
}
.global-nav-org {
  display: flex; align-items: center; gap: 6px;
  background: var(--color-chrome-hover); border-radius: 6px;
  padding: 5px 12px; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--color-chrome-strong);
  margin-right: 8px; transition: background 0.15s; white-space: nowrap;
}
.global-nav-org:hover { background: rgba(0,0,0,0.09); }
.global-nav-item {
  font-size: 12px; font-weight: 500; color: var(--color-chrome-muted);
  padding: 8px 0; cursor: pointer; transition: color 0.15s;
  border-bottom: 2px solid transparent;
  display: flex; align-items: center; gap: 4px;
}
.global-nav-item:hover { color: var(--color-chrome-strong); }
.global-nav-item.active { color: var(--color-chrome-strong); border-bottom-color: var(--color-primary); }
.global-nav-item .material-icons-round { font-size: 16px; }
.global-nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.global-nav-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--color-primary); color: #fff;
  font-size: 12px; font-weight: 700; display: flex; align-items: center;
  justify-content: center; cursor: pointer;
}
.user-dropdown {
  position: absolute; top: 100%; right: 0; background: #fff;
  border-radius: 8px; box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  min-width: 200px; padding: 8px 0; z-index: 500;
  animation: popupIn 0.15s ease;
}
.user-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; font-size: 13px; color: #555; cursor: pointer;
  transition: background 0.1s;
}
.user-dropdown-item:hover { background: #f5f5f5; }
.user-dropdown-header {
  padding: 12px 16px; border-bottom: 1px solid #f0f0f0;
}
.user-dropdown-name { font-size: 14px; font-weight: 600; color: #333; }
.user-dropdown-email { font-size: 12px; color: #999; }

/* === レスポンシブ === */
.mobile-tabs, .mobile-fab, .mobile-sheet-overlay { display: none; }
@media (min-width: 769px) {
  .task-star { opacity: 0; }
  .task-card:hover .task-star, .task-star[aria-pressed="true"] { opacity: 1; }
  #mobile-today-view { display: none !important; }
}

/* === モバイル対応 強化 === */
@media (max-width: 768px) {
  #app { height: 100dvh; }
  #main-content { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .mobile-tabs {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 160;
    min-height: calc(64px + env(safe-area-inset-bottom));
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    background: var(--color-card); border-top: 1px solid var(--color-border);
  }
  .mobile-tabs button {
    flex: 1; min-width: 0; min-height: 64px; display: flex; align-items: center;
    justify-content: center; flex-direction: column; gap: 3px;
    font-size: 11px; color: var(--color-chrome-text); white-space: nowrap;
  }
  .mobile-tabs button.active { color: var(--color-primary-hover); background: var(--color-primary-light); }
  .mobile-fab {
    display: flex; position: fixed; right: calc(18px + env(safe-area-inset-right));
    bottom: calc(82px + env(safe-area-inset-bottom)); z-index: 161;
    width: 56px; height: 56px; align-items: center; justify-content: center;
    border-radius: 50%; color: #fff; background: var(--color-primary);
    box-shadow: 0 4px 16px rgba(0,0,0,0.22);
    touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  }
  .mobile-fab .material-icons-round { font-size: 32px; }
  /* サイドバーと背景は既存の199/200。シートはその上、タスクモーダルの下。 */
  .mobile-sheet-overlay:not([hidden]) {
    display: flex; position: fixed; left: 0; right: 0;
    top: var(--mobile-viewport-top, 0); height: var(--mobile-viewport-height, 100dvh);
    z-index: 300; align-items: flex-end; background: rgba(0,0,0,0.4);
    overscroll-behavior: contain;
  }
  .mobile-sheet {
    width: 100%; max-height: 100%; overflow-y: auto; overscroll-behavior: contain;
    padding: 16px max(16px, env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    border-radius: 18px 18px 0 0; background: var(--color-card);
    box-shadow: 0 -6px 24px rgba(0,0,0,0.12); animation: mobileSheetIn 0.18s ease-out;
  }
  .mobile-sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
  .mobile-sheet-header h2 { font-size: 18px; }
  .mobile-close { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
  .mobile-sheet-description { font-size: 12px; color: var(--color-chrome-text); margin: 10px 0; overflow-wrap: anywhere; }
  .mobile-sheet label { display: block; margin-bottom: 8px; font-size: 13px; }
  .mobile-sheet input {
    width: 100%; min-height: 48px; padding: 10px 12px; font-size: 16px;
    border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-card);
  }
  .mobile-sheet input:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; }
  #mobile-quickadd-submit { width: 100%; min-height: 46px; margin-top: 12px; }
  #mobile-quickadd-submit:disabled { opacity: 0.55; cursor: wait; }
  #mobile-voice-transcript { min-height: 72px; margin: 12px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
  #mobile-voice-stop:not([hidden]), #mobile-voice-submit { width: 100%; min-height: 46px; margin-top: 12px; }
  #mobile-voice-stop:disabled, #mobile-voice-submit:disabled { opacity: 0.55; }
  #mobile-voice-sheet [hidden] { display: none; }
  .mobile-sheet .mobile-voice-candidate {
    display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 0;
    border-bottom: 1px solid var(--color-border); font-size: 16px; overflow-wrap: anywhere;
  }
  .mobile-sheet .mobile-voice-candidate input { flex: 0 0 22px; width: 22px; min-height: 22px; height: 22px; padding: 0; accent-color: var(--color-primary); }
  .mobile-voice-candidate span { min-width: 0; }
  .mobile-voice-description { display: block; margin-top: 6px; font-size: 12px; color: var(--color-chrome-text); white-space: pre-wrap; }
  .mobile-menu-links { border-top: 1px solid var(--color-border); margin-top: 14px; padding-top: 8px; }
  .mobile-menu-links button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; text-align: left; }
  .mobile-menu-links .material-icons-round { color: var(--color-primary-hover); }
  .mobile-sheet-overlay.is-searching .mobile-sheet {
    height: 100%; border-radius: 0; padding-top: max(16px, env(safe-area-inset-top));
    display: flex; flex-direction: column;
  }
  .is-searching .mobile-menu-links { display: none; }
  .is-searching .mobile-sheet-header, .is-searching input, .is-searching label, .is-searching .mobile-sheet-description { flex-shrink: 0; }
  #mobile-search-results { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .mobile-search-result { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 14px 4px; text-align: left; border-bottom: 1px solid var(--color-border); overflow-wrap: anywhere; }
  .mobile-search-project { font-size: 12px; color: var(--color-chrome-text); }
  #mobile-today-view { flex: 1; min-height: 0; flex-direction: column; gap: 20px; overflow-y: auto; padding: 24px 18px 90px; }
  #mobile-today-view h2 { display: flex; align-items: center; gap: 12px; font-size: 20px; }
  .mobile-today-count { font-size: 13px; color: var(--color-chrome-text); }
  .mobile-today-group h3 { font-size: 15px; overflow-wrap: anywhere; }
  .mobile-today-row { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--color-border); }
  .mobile-today-task { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 6px; width: 100%; padding: 14px 4px; text-align: left; overflow-wrap: anywhere; }
  .mobile-today-column { font-size: 12px; color: var(--color-chrome-text); }
  .task-star { min-width: 36px; min-height: 36px; }
  #toast-container { bottom: calc(150px + env(safe-area-inset-bottom)); max-width: calc(100vw - 40px); pointer-events: none; }
  @keyframes mobileSheetIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
  /* サイドバー: オーバーレイ表示 */
  #sidebar {
    position: fixed; left: 0; top: 0; height: 100%; z-index: 200;
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
  }
  #sidebar.collapsed { margin-left: -240px; box-shadow: none; }

  /* モバイルは閉じる(×)ボタンが出るので、横長ロゴが重ならないよう右に余白を確保 */
  .sidebar-header { padding-right: 48px; }

  /* サイドバー背景オーバーレイ */
  .sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    z-index: 199;
  }
  .sidebar-overlay.active { display: block; }

  /* グローバルナビ: 横スクロール */
  .global-nav {
    overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap; gap: 8px; padding: 0 10px;
    min-height: 38px; scrollbar-width: none;
  }
  .global-nav::-webkit-scrollbar { display: none; }
  .global-nav-org { padding: 4px 8px; font-size: 11px; margin-right: 4px; flex-shrink: 0; }
  .global-nav-org span:nth-child(2) { display: none; }
  .global-nav-item {
    font-size: 11px; padding: 6px 0; flex-shrink: 0; white-space: nowrap;
  }
  .global-nav-item .material-icons-round { font-size: 14px; }
  .global-nav-right { gap: 4px; flex-shrink: 0; }

  /* メインヘッダー */
  #main-header {
    padding: 0 10px; flex-wrap: nowrap; gap: 6px;
    min-height: 44px; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  #main-header::-webkit-scrollbar { display: none; }
  .header-left { flex-shrink: 0; gap: 6px; }
  .header-left #current-project-name { font-size: 13px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .header-project-desc { display: none; }
  .header-center { order: 0; flex: 0 0 auto; width: auto; margin-top: 0; }
  .header-tabs { gap: 0; }
  .tab-btn { padding: 0 8px; min-width: 36px; }
  .tab-btn .tab-label { display: none; }
  .header-right { flex-shrink: 0; gap: 4px; }
  .header-action-btn .tab-label { display: none; }
  .filter-panel { min-width: 320px !important; max-width: 95vw; }
  .filter-panel-body { flex-wrap: wrap; }
  .filter-panel-col { min-width: 50%; flex: none; border-right: none !important; border-bottom: 1px solid #f0f0f0; padding-bottom: 8px; margin-bottom: 4px; }

  /* カンバン */
  .kanban-column { min-width: 260px; max-width: 260px; }
  .task-card.mobile-swiping { will-change: transform; transition: none; }
  .mobile-swipe-label {
    position: fixed; z-index: 150; pointer-events: none;
    max-width: calc(100vw - 16px); padding: 6px 10px;
    border: 1px solid var(--color-primary); border-radius: var(--radius-sm);
    background: var(--color-card); color: var(--color-text);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    font-size: 12px; font-weight: 600; line-height: 20px; overflow-wrap: anywhere;
  }
  .mobile-swipe-label.is-ready { background: var(--color-primary); color: #fff; }

  /* モーダル */
  .modal-content { width: 100%; max-width: 100%; margin: 0; border-radius: 12px 12px 0 0; max-height: 90vh; }

  /* ダッシュボード */
  .dashboard-row { grid-template-columns: 1fr; }
  .dashboard-stats-row { grid-template-columns: repeat(2, 1fr); }

  /* 設定・メンバー */
  .settings-card { max-width: 100%; }
  .member-card { max-width: 100%; }
  .member-header { flex-direction: column; gap: 10px; align-items: flex-start; }
  .member-row { flex-wrap: wrap; padding: 12px; gap: 8px; }
  .member-actions { width: 100%; justify-content: flex-end; }
  .member-remove-btn { opacity: 1; }
  /* .access-panel のモバイル指定は、PC用の定義より後ろ（末尾）に置いている */

  /* プロジェクト一覧 */
  .pl-header { flex-direction: column; gap: 8px; padding: 12px 14px; }
  .pl-header-left { width: 100%; }
  .pl-header-right { width: 100%; }
  .pl-search { flex: 1; }
  .pl-grid { grid-template-columns: 1fr; gap: 10px; padding: 0 14px 14px; }
  .pl-card-top { gap: 10px; }
  .pl-card-icon { width: 40px; height: 40px; min-width: 40px; }
  .pl-card-icon-img { width: 40px; height: 40px; }
  .pl-card-icon-material { font-size: 24px; }

  /* プロジェクトリストビュー */
  #project-list-view { padding: 0; }
}

@media (max-width: 480px) {
  .kanban-column { min-width: 240px; max-width: 240px; }
  .task-card { padding: 8px 10px; }
  .global-nav { padding: 0 8px; gap: 6px; }
  .global-nav-item { font-size: 10px; }
  .global-nav-item .material-icons-round { font-size: 13px; }

  /* ダッシュボード統計 */
  .dashboard-stats-row { grid-template-columns: 1fr; }

}
/* ========== Admin Panel ========== */
#admin-view { flex:1; overflow-y:auto; padding:0; background:var(--color-bg); min-height:0; }

/* === Jooto風 組織管理レイアウト === */
.org-layout { display:flex; min-height:100%; }
.org-sidebar { width:220px; background:#fff; border-right:1px solid var(--color-border); flex-shrink:0; padding-top:0; }
.org-sidebar-header { display:flex; align-items:center; gap:8px; padding:20px 16px 16px; border-bottom:1px solid #f0f0f0; }
.org-sidebar-title { font-size:14px; font-weight:700; color:var(--color-primary); }
.org-sidebar-nav { padding:8px 0; }
.org-sidebar-item { display:flex; align-items:center; gap:10px; padding:10px 20px; font-size:13px; color:#555; cursor:pointer; transition:all 0.15s; border-left:3px solid transparent; }
.org-sidebar-item:hover { background:#f8f8f8; color:#333; }
.org-sidebar-item.active { background:var(--color-primary-light); color:var(--color-primary); font-weight:600; border-left-color:var(--color-primary); }

.org-main { flex:1; padding:0; min-width:0; }
.org-tabs { display:flex; gap:0; border-bottom:1px solid var(--color-border); background:#fff; padding:0 24px; }
.org-tab { padding:14px 20px; font-size:13px; font-weight:500; color:var(--color-text-secondary); cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-1px; transition:all 0.15s; }
.org-tab:hover { color:#333; }
.org-tab.active { color:#4a90d9; border-bottom-color:#4a90d9; font-weight:600; }

.org-section { padding:24px; }
.org-section-title { font-size:16px; font-weight:600; color:#333; margin-bottom:16px; }
.org-section-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.org-user-count { display:flex; align-items:center; gap:8px; font-size:15px; font-weight:600; color:#333; }
.org-filter-btn { width:32px; height:32px; border-radius:6px; display:flex; align-items:center; justify-content:center; color:#888; transition:background 0.15s; }
.org-filter-btn:hover { background:#f0f0f0; }
.org-filter-row { display:flex; align-items:center; gap:8px; padding:8px 12px; background:#fff; border:1px solid var(--color-border); border-radius:8px; margin-bottom:16px; }
.org-filter-input { border:none; outline:none; flex:1; font-size:13px; background:transparent; }

/* ユーザー行 (Jooto風) */
.org-user-row { display:grid; grid-template-columns:44px 1fr 140px 80px 1fr 40px; align-items:center; gap:12px; padding:14px 16px; background:#fff; border:1px solid #eee; border-radius:10px; margin-bottom:8px; transition:box-shadow 0.15s; }
.org-user-row:hover { box-shadow:0 2px 8px rgba(0,0,0,0.06); }
.org-user-row.inactive { opacity:0.45; }
.org-user-avatar { width:40px; height:40px; border-radius:50%; color:#fff; font-size:14px; font-weight:700; display:flex; align-items:center; justify-content:center; overflow:hidden; flex-shrink:0; }
.org-user-avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; }
.org-user-email { font-size:13px; color:#555; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.org-user-name { font-size:13px; font-weight:600; color:#333; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.org-you-badge { font-size:10px; color:var(--color-primary); font-weight:500; background:var(--color-primary-light); padding:1px 6px; border-radius:8px; }
.org-user-role { text-align:center; }
.org-role-badge { display:inline-block; padding:3px 10px; border-radius:4px; font-size:11px; font-weight:600; }
.org-role-badge.admin { background:#fee2e2; color:var(--color-danger); }
.org-role-badge.member { background:#e0f2fe; color:#0284c7; }
.org-role-badge.viewer { background:#f3f4f6; color:#6b7280; }
.org-user-projects { display:flex; align-items:center; gap:4px; overflow:hidden; flex-wrap:nowrap; }
.org-proj-badge { width:28px; height:28px; border-radius:6px; color:#fff; font-size:11px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.org-proj-more { font-size:11px; color:#888; font-weight:600; margin-left:2px; white-space:nowrap; }
.org-user-actions { display:flex; justify-content:center; }
.org-menu-btn { width:32px; height:32px; border-radius:6px; display:flex; align-items:center; justify-content:center; color:#999; transition:all 0.15s; }
.org-menu-btn:hover { background:#f0f0f0; color:#555; }

.org-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; padding:60px 20px; color:#999; font-size:13px; gap:8px; }

/* 組織情報カード */
.org-info-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
.org-info-card { background:#fff; border:1px solid #eee; border-radius:10px; padding:20px; text-align:center; }
.org-info-value { font-size:24px; font-weight:700; color:#333; margin:8px 0 4px; }
.org-info-label { font-size:12px; color:#888; }
.org-settings-card { background:#fff; border:1px solid #eee; border-radius:10px; padding:20px; }

/* 旧admin互換 */
.admin-badge { display:inline-block; padding:2px 8px; border-radius:var(--radius-sm); font-size:11px; font-weight:600; }
.admin-badge.admin { background:#fee2e2; color:var(--color-danger); }
.admin-badge.member { background:#e0f2fe; color:#0284c7; }
.admin-badge.active { background:#dcfce7; color:#16a34a; }
.admin-badge.inactive { background:#f3f4f6; color:#9ca3af; }

/* 組織設定セクション (Jooto風) */
.org-settings-section { background:#fff; border:1px solid #eee; border-radius:10px; padding:24px; margin-bottom:16px; }
.org-settings-section-title { font-size:16px; font-weight:700; color:#333; margin-bottom:4px; }
.org-settings-section-desc { font-size:13px; color:#888; line-height:1.5; }
.org-settings-link { display:inline-flex; align-items:center; gap:4px; font-size:13px; color:#4a90d9; font-weight:500; }
.org-settings-link:hover { text-decoration:underline; }

.org-service-row { display:flex; align-items:center; gap:14px; padding:16px 0; border-bottom:1px solid #f0f0f0; }
.org-service-row:last-child { border-bottom:none; }
.org-service-icon { width:40px; height:40px; border-radius:8px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.org-service-info { flex:1; min-width:0; }
.org-service-name { font-size:14px; font-weight:600; color:#333; }
.org-service-desc { font-size:12px; color:#888; margin-top:2px; }

/* 組織情報 (Jooto風) */
.org-detail-section { background:#fff; border:1px solid #eee; border-radius:10px; padding:24px; margin-bottom:16px; }
.org-detail-heading { font-size:16px; font-weight:700; color:#333; margin-bottom:12px; }
.org-detail-value { font-size:15px; color:#333; font-weight:500; }
.org-detail-sub { font-size:12px; color:#999; margin-top:4px; }
.org-info-table { }
.org-info-row { display:flex; padding:8px 0; border-bottom:1px solid #f8f8f8; }
.org-info-row:last-child { border-bottom:none; }
.org-info-key { width:180px; font-size:13px; font-weight:600; color:#555; flex-shrink:0; }
.org-info-val { font-size:13px; color:#333; }
.org-info-divider { height:1px; background:#e8eaed; margin:8px 0; }

/* Jooto風 通知設定モーダル */
.notify-modal-header { display:flex; align-items:center; justify-content:space-between; padding:16px 24px; border-bottom:1px solid #e8eaed; }
.notify-modal-title { font-size:16px; font-weight:700; color:#333; }
.notify-project-selector { display:flex; align-items:center; gap:10px; padding:16px 24px; border-bottom:1px solid #e8eaed; }
.notify-project-icon { width:28px; height:28px; border-radius:6px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.notify-project-select { flex:1; border:1px solid #e0e0e0; border-radius:6px; padding:8px 12px; font-size:13px; font-weight:500; appearance:auto; background:#fff; }

.notify-grid-header { display:grid; grid-template-columns:1fr 80px 80px; align-items:center; padding:12px 0; border-bottom:1px solid #e8eaed; }
.notify-grid-row { display:grid; grid-template-columns:1fr 80px 80px; align-items:center; padding:10px 0; border-bottom:1px solid #f5f5f5; }
.notify-grid-row.all-row { font-weight:600; }
.notify-grid-row:last-child { border-bottom:none; }
.notify-grid-label { font-size:13px; color:#333; }
.notify-grid-col { text-align:center; font-size:12px; color:#888; }

/* Jooto風チェックボックス */
.notify-checkbox { display:inline-flex; cursor:pointer; }
.notify-checkbox input { display:none; }
.notify-cb-visual { width:20px; height:20px; border:2px solid #d0d0d0; border-radius:4px; display:flex; align-items:center; justify-content:center; transition:all 0.15s; }
.notify-checkbox input:checked + .notify-cb-visual { background:#4a90d9; border-color:#4a90d9; }
.notify-checkbox input:checked + .notify-cb-visual::after { content:'✓'; color:#fff; font-size:12px; font-weight:700; }

.notify-modal-footer { display:flex; justify-content:center; gap:16px; padding:16px 24px; border-top:1px solid #e8eaed; }
.notify-modal-footer .btn { min-width:120px; }

@media (max-width:900px) {
  .org-sidebar { display:none; }
  .org-user-row { grid-template-columns:40px 1fr 80px 40px; }
  .org-user-name, .org-user-projects { display:none; }
  .org-info-grid { grid-template-columns:repeat(2,1fr); }
}

/* Project access panel */
.access-panel { display:grid; grid-template-columns:250px 1fr; gap:16px; }
.access-member-list { background:var(--color-card); border-radius:var(--radius-md); border:1px solid var(--color-border); overflow-y:auto; max-height:500px; }
.access-member-item { display:flex; align-items:center; gap:8px; padding:10px 14px; cursor:pointer; border-bottom:1px solid var(--color-bg); font-size:13px; transition:background 0.15s; }
.access-member-item:hover { background:#f8f8f8; }
.access-member-item.selected { background:#eff6ff; border-left:3px solid #3b82f6; }
.access-project-list { background:var(--color-card); border-radius:var(--radius-md); border:1px solid var(--color-border); padding:16px; }
.access-project-item { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid #f8f8f8; font-size:13px; }
.access-project-item label { cursor:pointer; display:flex; align-items:center; gap:8px; flex:1; }
@media (max-width: 768px) {
  /* 1カラムに畳む。PC用 .access-panel より後ろに置くこと（同じ詳細度なので順序で決まる） */
  .access-panel { grid-template-columns: 1fr; }
  .access-member-list { max-height: 200px; }
  .access-project-item { flex-wrap: wrap; }
  .access-project-item label { min-width: 0; overflow-wrap: anywhere; }
}

/* === Settings Row === */
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid #f0f0f0; gap: 16px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row-left { flex: 1; min-width: 0; }
.settings-row-title { font-size: 14px; font-weight: 600; color: var(--color-text); margin-bottom: 2px; }
.settings-row-desc { font-size: 12px; color: var(--color-text-secondary); line-height: 1.4; }

/* === Toggle Switch === */
.toggle-switch {
  position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #ccc; border-radius: 24px; transition: 0.3s;
}
.toggle-slider::before {
  content: ''; position: absolute; height: 18px; width: 18px;
  left: 3px; bottom: 3px; background: #fff; border-radius: 50%;
  transition: 0.3s; box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-slider { background: var(--color-primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* === Project Drag & Drop === */
.nav-item .drag-handle { opacity: 0; transition: opacity 0.15s; margin-right: 2px; }
.nav-item.dragging { opacity: 0.4; background: rgba(77,192,181,0.1); }
.nav-item.drag-over-top { box-shadow: inset 0 2px 0 0 var(--color-primary); }
.nav-item.drag-over-bottom { box-shadow: inset 0 -2px 0 0 var(--color-primary); }

/* === All Views (全てのタスク/ガントチャート) === */
#all-tasks-view, #all-gantt-view {
  flex: 1; overflow-y: auto; background: var(--color-bg);
}

/* === Notification Settings Modal === */
.notify-section {
  border-bottom: 1px solid #f0f0f0;
}
.notify-section:last-of-type { border-bottom: none; }
.notify-section-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
}
.notify-section-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.notify-section-icon .material-icons-round { font-size: 20px; }
.notify-section-title {
  flex: 1; font-size: 15px; font-weight: 700; color: var(--color-text);
}
.notify-section-body {
  padding: 0 20px 16px;
}
.notify-help-text {
  font-size: 12px; color: #999; line-height: 1.6; margin-bottom: 12px;
}

/* タイミング選択リスト */
.notify-timing-list {
  display: flex; flex-direction: column; gap: 4px;
}
.notify-timing-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px; cursor: pointer;
  border: 1.5px solid #e8eaed; transition: all 0.15s;
  background: #fff;
}
.notify-timing-item:hover {
  border-color: #ccc; background: #fafafa;
}
.notify-timing-item.active {
  border-color: var(--color-primary); background: rgba(77,192,181,0.04);
}
.notify-timing-item input[type="checkbox"] {
  display: none;
}
.notify-timing-info {
  flex: 1; min-width: 0;
}
.notify-timing-label {
  font-size: 14px; font-weight: 600; color: var(--color-text);
  display: block;
}
.notify-timing-desc {
  font-size: 11px; color: #999; display: block; margin-top: 1px;
}
.notify-timing-check { flex-shrink: 0; }

/* その他通知オプション */
.notify-option-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid #f5f5f5;
}
.notify-option-row:last-child { border-bottom: none; }
.notify-option-info {
  flex: 1; display: flex; align-items: flex-start; gap: 10px; min-width: 0;
}
.notify-option-title {
  font-size: 13px; font-weight: 600; color: var(--color-text);
}
.notify-option-desc {
  font-size: 11px; color: #999; line-height: 1.4; margin-top: 1px;
}

/* フッター */
.notify-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-top: 1px solid #e8eaed; background: #fafafa;
}

/* === Profile Modal === */
.profile-modal { overflow: hidden; }
.profile-cover {
  height: 100px; background: linear-gradient(135deg, #4DC0B5, #2DD4BF, #38BDF8);
  position: relative;
}
.profile-avatar-section {
  display: flex; flex-direction: column; align-items: center;
  margin-top: -48px; position: relative; z-index: 10;
}
.profile-avatar {
  width: 96px; height: 96px; border-radius: 50%;
  background: #fff; border: 4px solid #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.profile-avatar-img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.profile-avatar-initial {
  font-size: 36px; font-weight: 700; color: #fff;
  width: 100%; height: 100%; border-radius: 50%;
  background: linear-gradient(135deg, #4DC0B5, #6C8EEF);
  display: flex; align-items: center; justify-content: center;
}
.profile-photo-actions {
  display: flex; gap: 6px; margin-top: 10px;
}
.profile-info-header {
  text-align: center; padding: 12px 24px 4px;
}
.profile-name {
  font-size: 20px; font-weight: 700; color: var(--color-text);
}
.profile-email {
  font-size: 13px; color: #999; margin-top: 2px;
}
.profile-badges {
  margin-top: 8px; display: flex; gap: 6px; justify-content: center;
}
.profile-badge {
  font-size: 11px; font-weight: 700; padding: 3px 12px; border-radius: 20px;
}
.profile-badge.role-admin {
  background: rgba(220,38,38,0.1); color: #dc2626;
}
.profile-badge.role-member {
  background: rgba(77,192,181,0.1); color: #4DC0B5;
}
.profile-stats {
  display: flex; justify-content: center; gap: 0;
  padding: 16px 24px; margin: 12px 24px 0;
  border: 1px solid #e8eaed; border-radius: 12px; background: #fafafa;
}
.profile-stat {
  flex: 1; text-align: center; padding: 4px 0;
}
.profile-stat + .profile-stat { border-left: 1px solid #e8eaed; }
.profile-stat-value {
  font-size: 18px; font-weight: 700; color: var(--color-text);
}
.profile-stat-label {
  font-size: 11px; color: #999; margin-top: 2px;
}
.profile-form {
  padding: 16px 24px 24px;
}
.profile-form-title {
  font-size: 14px; font-weight: 700; color: var(--color-text);
  margin-bottom: 14px; display: flex; align-items: center; gap: 6px;
  padding-bottom: 10px; border-bottom: 1px solid #e8eaed;
}
.profile-field {
  margin-bottom: 12px;
}
.profile-field-label {
  font-size: 12px; font-weight: 600; color: #666; margin-bottom: 4px; display: block;
}
.profile-view-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid #f5f5f5; font-size: 13px;
}
.profile-view-row:last-child { border-bottom: none; }
.profile-view-label {
  width: 80px; flex-shrink: 0; color: #999; font-size: 12px; font-weight: 600;
}

/* === プロジェクトカード アイコン === */
.pl-card-top {
  display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px;
}
.pl-card-icon {
  width: 48px; height: 48px; min-width: 48px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.pl-card-icon-img {
  width: 48px; height: 48px; object-fit: cover; border-radius: 10px;
}
.pl-card-icon-material {
  font-size: 28px; color: #fff !important;
}
.pl-card-info {
  flex: 1; min-width: 0;
}

/* === モバイル ハンバーガー & サイドバー閉じるボタン === */
.global-nav-hamburger {
  display: none; color: var(--color-chrome-text); padding: 4px; border-radius: 6px;
  flex-shrink: 0; background: none; border: none; cursor: pointer;
}
.global-nav-hamburger .material-icons-round { font-size: 22px; }
.global-nav-hamburger:hover { background: var(--color-chrome-hover); }

.sidebar-close-btn {
  display: none; position: absolute; top: 12px; right: 10px;
  color: var(--color-chrome-muted); background: none; border: none; cursor: pointer;
  padding: 4px; border-radius: 6px; z-index: 10;
}
.sidebar-close-btn:hover { color: var(--color-chrome-strong); background: var(--color-chrome-hover); }
.sidebar-close-btn .material-icons-round { font-size: 20px; }

@media (max-width: 768px) {
  .global-nav-hamburger { display: flex; align-items: center; }
  .sidebar-close-btn { display: block; }
  .sidebar-header { position: relative; }
}

/* ========== 認証情報セクション ========== */
.cred-section .task-detail-section-title {
  display: flex; align-items: center; gap: 6px;
}
.cred-item {
  background: #f8f9fc;
  border: 1px solid #e8eaed;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 13px;
}
.cred-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.cred-label {
  font-weight: 700; color: #444; font-size: 13px;
}
.cred-actions {
  display: flex; gap: 2px;
}
.cred-field {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 0; color: #555;
}
.cred-field-icon {
  font-size: 15px !important; color: #aaa; flex-shrink: 0;
}
.cred-value {
  flex: 1; word-break: break-all;
  font-family: 'Courier New', monospace; font-size: 12px; color: #333;
}
.cred-pw {
  letter-spacing: 2px;
}
.cred-url-link {
  flex: 1; color: #4DC0B5; text-decoration: none; word-break: break-all;
  font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px;
}
.cred-url-link:hover { text-decoration: underline; }
.cred-copy-btn {
  background: none; border: none; cursor: pointer; padding: 2px;
  color: #bbb; border-radius: 4px; display: flex; align-items: center;
  flex-shrink: 0;
}
.cred-copy-btn:hover { color: #4DC0B5; background: rgba(77,192,181,0.1); }
.cred-copy-btn .material-icons-round { font-size: 14px !important; }
.cred-icon-btn {
  background: none; border: none; cursor: pointer; padding: 3px;
  color: #bbb; border-radius: 4px; display: flex; align-items: center;
  flex-shrink: 0;
}
.cred-icon-btn:hover { color: #555; background: #eee; }
.cred-icon-btn.danger:hover { color: #e74c3c; background: rgba(231,76,60,0.08); }
.cred-icon-btn .material-icons-round { font-size: 15px !important; }
.cred-memo {
  color: #888; font-size: 12px; margin-top: 4px;
  padding-top: 4px; border-top: 1px solid #e8eaed;
  white-space: pre-wrap;
}
.cred-form {
  background: #f8f9fc;
  border: 1px solid #d0e4f7;
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 8px;
}
.cred-form-row {
  margin-bottom: 10px;
}
.cred-form-row label {
  display: block; font-size: 11px; font-weight: 600;
  color: #666; margin-bottom: 4px;
}


/* 承認待ち（クライアント管理の TM: タグから届いた参加申請） */
.join-note { font-size:12px; color:#888; line-height:1.7; margin:0 0 16px; }
.join-nw { white-space:nowrap; }
.join-warning { background:#FFF7E6; border:1px solid #FFE0A3; border-radius:8px; padding:8px 12px; font-size:12px; color:#8A5A00; margin-bottom:8px; }
.join-empty { padding:40px; text-align:center; color:#999; font-size:13px; }
.join-card { background:#fff; border:1px solid #eee; border-radius:10px; padding:14px 16px; margin-bottom:8px; }
.join-card-head { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 12px; }
.join-card-name { font-size:15px; font-weight:600; color:#333; }
.join-card-meta { font-size:12px; color:#888; }
.join-card-project { font-size:12px; color:#888; margin-left:auto; white-space:nowrap; }
.join-card-label { display:block; font-size:12px; color:#666; margin:10px 0 4px; }
.join-card-input { width:100%; max-width:420px; }
.join-card-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:12px; }
#join-invite-text { width:100%; resize:vertical; }

/* === ファイル画面（Google ドライブ連携） === */
.files-notice {
  margin: 8px 16px; padding: 8px 12px; border-left: 3px solid #d9b65a;
  background: #fdfaf2; color: #6b5a2a; font-size: 12px; line-height: 1.6;
}
.files-dragover { outline: 2px dashed var(--color-primary, #4C9A97); outline-offset: -8px; }
.file-table a { color: inherit; text-decoration: none; }
.file-table a:hover { text-decoration: underline; }

/* 狭い幅では「サイズ」「最終更新者」を落とす（横スクロールさせない）。
   デスクトップの .file-table より後ろ、かつ CS専用セクション群より前に置くこと
   （CSの印より後ろの指定は「CS専用」とみなす検査があるため）。 */
@media (max-width: 767px) {
  .file-table .files-col-wide { display: none; }
  .file-header { flex-wrap: wrap; gap: 8px; }
}

/* ファイル名の変更ボタン。
   名前が2行に折り返しても見つけられるよう、名前の右に固定して並べる（下に落とさない）。
   常に薄く出しておき、行にマウスを載せるとはっきりさせる。
   hover だけに頼ると、指で触る画面では永久に見つからない。 */
.file-table td:first-child { display: flex; align-items: flex-start; gap: 6px; }
.file-table td:first-child > a { flex: 1; min-width: 0; }
.file-table .files-rename {
  flex: 0 0 auto; opacity: .45; transition: opacity .12s;
  padding: 0; background: none; border: 0; cursor: pointer; line-height: 1;
}
.file-table tr:hover .files-rename { opacity: 1; }
.file-table .files-rename:hover { opacity: 1; }
.file-table .files-rename:focus-visible { opacity: 1; outline: 2px solid var(--color-primary, #4DC0B5); outline-offset: 2px; }

/* === 人ごとのタスク一覧 === */
.byperson-list { background:#fff; border-radius:8px; overflow:hidden; }
.byperson-row { padding:12px 16px; border-bottom:1px solid #f0f0f0; cursor:pointer; transition:background .12s; }
.byperson-row:last-child { border-bottom:0; }
.byperson-row:hover { background:#fafafa; }
.byperson-none { background:#fcfcfc; }
.byperson-head { display:flex; align-items:center; gap:8px; margin-bottom:6px; flex-wrap:wrap; }
.byperson-name { font-size:14px; font-weight:600; color:#333; }
.byperson-total { margin-left:auto; font-size:13px; font-weight:700; color:#4DC0B5; }
.byperson-warn { font-size:11px; color:#92400e; background:#fffbeb; border:1px solid #fde68a; border-radius:4px; padding:1px 6px; }
.byperson-bar { height:5px; background:#f0f0f0; border-radius:3px; overflow:hidden; margin-bottom:6px; }
.byperson-bar > span { display:block; height:100%; background:#4DC0B5; border-radius:3px; }
.byperson-none .byperson-bar > span { background:#cbd5e1; }
.byperson-note { background:#fffbeb; border-left:3px solid #f59e0b; color:#92400e;
  font-size:12px; line-height:1.6; padding:8px 12px; border-radius:4px; margin-bottom:10px; }
.byperson-people { font-size:11px; color:#999; margin-bottom:6px; line-height:1.5; }
.byperson-nums { display:flex; gap:14px; font-size:12px; color:#777; flex-wrap:wrap; }
.byperson-nums b { color:#333; font-weight:700; }
.byperson-bad b { color:#dc2626; }
.byperson-chip { display:flex; align-items:center; gap:8px; background:#fff; border:1px solid #e0e0e0;
  border-radius:8px; padding:8px 12px; margin-bottom:12px; font-size:13px; color:#333; flex-wrap:wrap; }
.byperson-chip button { margin-left:auto; border:0; background:none; color:#4DC0B5; font-size:12px; cursor:pointer; padding:2px 6px; }
.byperson-chip button:hover { text-decoration:underline; }

/* Fixed links are available only while viewing the CS clinic project. */
#clinic-portal-links { display:flex; gap:8px; flex-wrap:wrap; }
.clinic-portal-link { color:var(--color-primary); font-size:12px; text-decoration:none; padding:5px 8px; border:1px solid currentColor; border-radius:6px; }
.clinic-portal-link:hover { text-decoration:underline; }
@media (max-width:768px) { #clinic-portal-links { gap:4px; } .clinic-portal-link { font-size:11px; padding:4px; } }

/* CS clinic workspace surfaces — fixed CS project only; keep group accent/branding. */
body[data-clinic-workspace="cs"] {
  --clinic-paper: #f5f9f7;
  --clinic-ink: #234d48;
  --clinic-line: #dce8e1;
  --color-bg: var(--clinic-paper);
  --color-text: var(--clinic-ink);
  --color-text-secondary: #56736a;
  --color-border: var(--clinic-line);
  font-family: 'Noto Sans JP', 'Inter', -apple-system, sans-serif;
}
body[data-clinic-workspace="cs"] #main-header,
body[data-clinic-workspace="cs"] .global-nav { background: #fff; border-color: var(--clinic-line); }
body[data-clinic-workspace="cs"] #kanban-view { background: var(--clinic-paper); }
body[data-clinic-workspace="cs"] .kanban-column {
  background: #edf5f0; border-color: var(--clinic-line); border-radius: 20px;
  box-shadow: 0 2px 6px rgba(35,77,72,0.04);
}
body[data-clinic-workspace="cs"] .column-color-bar { border-radius: 20px 20px 0 0; }
body[data-clinic-workspace="cs"] .task-card {
  background: #fff; border-color: var(--clinic-line); border-radius: 16px;
  box-shadow: 0 1px 3px rgba(35,77,72,0.04);
}
body[data-clinic-workspace="cs"] .task-card:hover {
  border-color: var(--color-primary); box-shadow: 0 3px 8px rgba(35,77,72,0.08);
}
body[data-clinic-workspace="cs"] .task-card-title { font-size: 13px; line-height: 1.65; }
body[data-clinic-workspace="cs"] .dashboard-section-card,
body[data-clinic-workspace="cs"] .stat-card,
body[data-clinic-workspace="cs"] .settings-card,
body[data-clinic-workspace="cs"] .filter-panel {
  background: #fff; border-color: var(--clinic-line); border-radius: 18px;
}
body[data-clinic-workspace="cs"] .column-top-add-btn,
body[data-clinic-workspace="cs"] .header-action-btn { border-radius: 10px; }
body[data-clinic-workspace="cs"] .clinic-portal-link { border-radius: 10px; }
body[data-clinic-workspace="cs"] :focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }
@media (pointer:coarse) {
  body[data-clinic-workspace="cs"] .column-header-actions,
  body[data-clinic-workspace="cs"] .task-card-menu { opacity: 1; }
  body[data-clinic-workspace="cs"] .column-top-add-btn,
  body[data-clinic-workspace="cs"] .add-task-btn,
  body[data-clinic-workspace="cs"] .header-action-btn,
  body[data-clinic-workspace="cs"] .clinic-portal-link { min-height: 44px; }
}

/* CS clinic responsive headers — retain horizontal labels and reachable account menu. */
body[data-clinic-workspace="cs"] .global-nav-item { white-space: nowrap; flex-shrink: 0; }
body[data-clinic-workspace="cs"] .tab-btn { white-space: nowrap; flex-shrink: 0; }
body[data-clinic-workspace="cs"] .header-action-btn,
body[data-clinic-workspace="cs"] .clinic-portal-link { white-space: nowrap; flex-shrink: 0; }
body[data-clinic-workspace="cs"] #clinic-portal-links { flex-shrink: 0; }
@media (min-width:769px) {
  body[data-clinic-workspace="cs"] .global-nav { flex-wrap: wrap; gap: 8px 12px; padding-top: 6px; padding-bottom: 6px; }
  body[data-clinic-workspace="cs"] .global-nav-right { flex-shrink: 0; flex-wrap: wrap; }
  body[data-clinic-workspace="cs"] #main-header { flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
  body[data-clinic-workspace="cs"] .header-left,
  body[data-clinic-workspace="cs"] .header-right { flex-shrink: 0; }
  body[data-clinic-workspace="cs"] .header-center { min-width: 0; flex: 1 0 auto; }
  body[data-clinic-workspace="cs"] .header-tabs { flex-shrink: 0; }
}
@media (min-width:769px) and (max-width:1100px) {
  body[data-clinic-workspace="cs"] .global-nav-right { flex: 1 0 100%; justify-content: flex-end; }
  body[data-clinic-workspace="cs"] .header-center { order: 3; flex: 1 0 100%; overflow-x: auto; justify-content: flex-start; }
  body[data-clinic-workspace="cs"] .header-tabs { height: 44px; }
  body[data-clinic-workspace="cs"] .tab-btn { padding: 0 10px; }
  body[data-clinic-workspace="cs"] .header-right { flex-wrap: wrap; }
}
