* { box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Noto Sans JP', sans-serif; }
:root {
  --sidebar-width: 260px;
  --right-panel-width: 280px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* =====================================================
   APP SHELL — 3-column fixed layout
   Left(260px) | Center(flex-1) | Right(280px)
   ===================================================== */
#app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* COL 1 — Sidebar */
#sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

/* COL 2 — Main content */
#main-content {
  flex: 1;
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* COL 3 — Right panel */
#right-panel-col {
  width: var(--right-panel-width);
  min-width: var(--right-panel-width);
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  transition: width 0.25s ease, min-width 0.25s ease;
  position: relative;
}
#right-panel-col.collapsed {
  width: 0;
  min-width: 0;
  overflow: hidden;
}

/* 右パネル開閉トグルボタン */
#rp-toggle-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  right: calc(var(--right-panel-width) - 1px);
  z-index: 30;
  width: 18px;
  height: 48px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-right: none;
  border-radius: 6px 0 0 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 10px;
  transition: right 0.25s ease, background 0.15s, color 0.15s;
  box-shadow: -2px 0 6px rgba(0,0,0,0.06);
}
#rp-toggle-btn:hover {
  background: #f1f5f9;
  color: #475569;
}
#right-panel-col.collapsed ~ #rp-toggle-btn,
body.rp-collapsed #rp-toggle-btn {
  right: 0;
  border-radius: 6px 0 0 6px;
  border-right: none;
}

/* Mobile header: hidden by default, shown only on mobile */
#mobile-header {
  display: none;
}

/* Mobile — sidebar slides in, right panel hidden */
#sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 40;
}

@media (max-width: 767px) {
  #sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    overflow-y: auto; /* サイドバー全体をスクロール可能に */
  }
  #sidebar.open { transform: translateX(0); }
  #sidebar-overlay.open { display: block; }
  #mobile-header { display: flex !important; visibility: visible !important; opacity: 1 !important; }
  #right-panel-col { display: none !important; }
  #rp-toggle-btn { display: none !important; }
}
@media (min-width: 768px) and (max-width: 1199px) {
  #mobile-header { display: none !important; }
  #sidebar { transform: translateX(0) !important; }
  #right-panel-col { display: none !important; }
  #rp-toggle-btn { display: none !important; }
}
@media (min-width: 1200px) {
  #mobile-header { display: none !important; }
  #sidebar { transform: translateX(0) !important; }
}

/* Status badges */
.status-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 9999px;
  font-size: 11px; font-weight: 600;
  cursor: pointer; border: none;
  transition: all 0.15s;
  white-space: nowrap;
  user-select: none;
}
/* ── 今日実行ボタン（締切ページ） ── */
.exec-today-btn {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 600;
  background: #f0fdf4; color: #15803d;
  border: 1.5px solid #86efac; border-radius: 8px;
  padding: 2px 9px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap; font-family: inherit;
}
.exec-today-btn:hover { background: #dcfce7; border-color: #4ade80; }
.exec-today-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 600;
  background: #dcfce7; color: #15803d;
  border-radius: 8px; padding: 2px 9px; white-space: nowrap;
}

/* ── 作業時間タグ ── */
.time-tag-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 600; border-radius: 6px;
  padding: 2px 7px; white-space: nowrap; flex-shrink: 0;
}
.tt-5min   { background: #fef9c3; color: #854d0e; border: 1px solid #fde68a; }
.tt-15min  { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.tt-30min  { background: #ede9fe; color: #5b21b6; border: 1px solid #ddd6fe; }
.tt-1h     { background: #fce7f3; color: #9d174d; border: 1px solid #fbcfe8; }
.tt-over1h { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

/* タグ選択ボタン（モーダル内） */
.time-tag-select-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 500; border-radius: 8px;
  padding: 4px 11px; cursor: pointer; border: 1.5px solid #e2e8f0;
  background: #f8fafc; color: #64748b; transition: all 0.12s;
  font-family: inherit;
}
.time-tag-select-btn:hover { background: #f1f5f9; border-color: #cbd5e1; }
.time-tag-select-btn.active { background: #eef2ff; color: #4338ca; border-color: #818cf8; font-weight: 700; }

.status-未着手  { background: #f1f5f9; color: #64748b; }
.status-進行中  { background: #dbeafe; color: #1d4ed8; }
.status-対応待ち { background: #fef9c3; color: #854d0e; }
.status-保留    { background: #f3e8ff; color: #7e22ce; }
.status-完了    { background: #dcfce7; color: #166534; }
.status-btn:hover { opacity: 0.8; transform: scale(1.04); }

/* Deadline badges */
.dl-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 9999px; font-size: 11px; font-weight: 500;
}
.dl-urgent { background: #fef2f2; color: #dc2626; }
.dl-warning { background: #fffbeb; color: #d97706; }
.dl-normal { background: #f0fdf4; color: #16a34a; }
.dl-none { background: #f1f5f9; color: #94a3b8; }

/* Cards */
.task-row {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  margin-bottom: 8px;
  padding: 12px 14px;
  transition: all 0.15s;
}
.task-row:hover { box-shadow: 0 3px 10px rgba(0,0,0,0.06); border-color: #c7d2fe; }
.task-row.selected { border-color: #6366f1; background: #fafaff; }
.task-row-completed-phase { background: #f8fafc !important; border-color: #e2e8f0 !important; opacity: 0.65; }
.task-row-completed-phase:hover { box-shadow: none !important; border-color: #e2e8f0 !important; }
.task-row-completed-phase .font-medium { color: #94a3b8 !important; }
.task-row-completed-phase .phase-badge { background: #e2e8f0 !important; color: #94a3b8 !important; border-color: #e2e8f0 !important; }
.task-row-completed-phase .status-btn { opacity: 0.6; }
.task-row-priority { background: #fff5f5 !important; border-color: #fca5a5 !important; }
.task-row-priority:hover { box-shadow: 0 3px 10px rgba(239,68,68,0.12) !important; border-color: #f87171 !important; }
.task-row-waiting { background: #fffbeb !important; border-color: #fcd34d !important; }
.task-row-waiting:hover { box-shadow: 0 3px 10px rgba(245,158,11,0.12) !important; border-color: #fbbf24 !important; }
.priority-star-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; border: none; background: transparent; font-size: 16px; color: #cbd5e1; cursor: pointer; transition: all 0.15s; line-height: 1; padding: 0; }
.priority-star-btn:hover { color: #f59e0b; background: #fef3c7; }
.priority-star-btn.active { color: #f59e0b; background: #fef9c3; }

/* Section card */
.section-card {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  margin-bottom: 14px;
}
.section-header {
  padding: 14px 18px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; user-select: none;
  border-radius: 4px;
}
.section-header:hover { background: rgba(99,102,241,0.04); }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-box {
  background: white;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  padding: 28px;
}

/* Inputs */
.inp {
  width: 100%; padding: 8px 12px;
  border: 1px solid #e2e8f0; border-radius: 4px;
  font-size: 14px; color: #1e293b;
  background: #f8fafc;
  transition: border-color 0.15s, background 0.15s;
  outline: none;
  font-family: inherit;
}
.inp:focus { border-color: #6366f1; background: white; }
.inp-sm { padding: 5px 10px; font-size: 12px; }
textarea.inp { resize: vertical; min-height: 80px; }
input[type="date"] { color-scheme: light; }

/* ── モーダル カスタムステータスドロップダウン ── */
.status-dropdown { position: relative; }
.status-dropdown-btn {
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; text-align: left;
  padding: 8px 12px;
}
.status-dropdown-btn:focus { border-color: #6366f1; background: white; outline: none; }
.status-dropdown-menu {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: white; border: 1px solid #e2e8f0;
  border-radius: 4px; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 500; padding: 4px;
  max-height: 300px; overflow-y: auto;
}
.sdm-option {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 10px; border-radius: 7px;
  font-size: 13px; font-weight: 500; color: #1e293b;
  cursor: pointer; border: none; background: transparent;
  text-align: left; transition: background 0.12s;
  font-family: inherit;
}
.sdm-option:hover { background: #f1f5f9; }
.sdm-option.sdm-active { background: #eef2ff; color: #4338ca; font-weight: 700; }
.sdm-icon { font-size: 12px; width: 16px; text-align: center; flex-shrink: 0; }
.sdm-check { font-size: 11px; margin-left: auto; color: #6366f1; flex-shrink: 0; }

/* Buttons */
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 4px;
  background: #6366f1; color: white;
  font-size: 14px; font-weight: 600;
  border: none; cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  font-family: inherit;
}
.btn-primary:hover { background: #4f46e5; }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 4px;
  background: white; color: #374151;
  font-size: 14px; font-weight: 500;
  border: 1px solid #d1d5db; cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
.btn-secondary:hover { background: #f9fafb; }
.btn-danger {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 4px;
  background: #fef2f2; color: #dc2626;
  font-size: 14px; font-weight: 500;
  border: 1px solid #fecaca; cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
.btn-danger:hover { background: #fee2e2; }
.btn-icon {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px; border: none;
  cursor: pointer; font-size: 12px;
  transition: all 0.15s;
  background: transparent;
  font-family: inherit;
}

/* Sidebar items */
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-radius: 3px;
  cursor: pointer; font-size: 14px; color: #475569;
  transition: all 0.15s;
  user-select: none;
}
.sidebar-item:hover { background: #f1f5f9; color: #1e293b; }
.sidebar-item.active { background: #eef2ff; color: #4f46e5; font-weight: 600; }
.sidebar-item .icon { width: 18px; text-align: center; font-size: 13px; flex-shrink: 0; }

/* Project tabs */
.project-tab {
  padding: 10px 18px; font-size: 14px; font-weight: 500;
  color: #64748b; border-bottom: 2px solid transparent;
  cursor: pointer; transition: all 0.15s;
  white-space: nowrap;
  user-select: none;
}
.project-tab.active { color: #4f46e5; border-bottom-color: #4f46e5; font-weight: 600; }
.project-tab:hover:not(.active) { color: #1e293b; }

/* Progress memo timeline */
.memo-timeline-item {
  border-left: 2px solid #e2e8f0;
  padding-left: 14px; margin-left: 8px;
  position: relative; margin-bottom: 10px;
}
.memo-timeline-item::before {
  content: '';
  width: 8px; height: 8px;
  background: #6366f1; border-radius: 50%;
  position: absolute; left: -5px; top: 5px;
}

/* Collapse */
.collapse-content {
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.collapse-content.collapsed { max-height: 0 !important; }

/* Custom checkbox */
.custom-check {
  width: 20px; height: 20px; border-radius: 5px;
  border: 2px solid #d1d5db; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s; flex-shrink: 0;
}
.custom-check.checked { background: #6366f1; border-color: #6366f1; color: white; }

/* Empty state */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: #94a3b8; font-size: 14px;
}
.empty-state i { font-size: 40px; margin-bottom: 16px; display: block; opacity: 0.3; }

/* Toast */
#toast {
  position: fixed; bottom: 24px; right: 24px;
  background: #1e293b; color: white;
  padding: 12px 20px; border-radius: 4px;
  font-size: 14px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  transform: translateY(100px); opacity: 0;
  transition: all 0.3s; z-index: 999;
  pointer-events: none;
}
#toast.show { transform: translateY(0); opacity: 1; }

/* Tags */
.tag {
  padding: 2px 8px; border-radius: 9999px;
  font-size: 11px; font-weight: 600;
}
.tag-MTG { background: #dbeafe; color: #1d4ed8; }
.tag-評価日 { background: #fce7f3; color: #9d174d; }
.tag-施策トリガー { background: #fef9c3; color: #854d0e; }
.tag-その他 { background: #f1f5f9; color: #64748b; }

/* MTG item */
.mtg-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  background: white; border: 1px solid #e2e8f0;
  border-radius: 4px; margin-bottom: 8px;
  transition: all 0.15s;
}
.mtg-item.done { opacity: 0.55; }
.mtg-item.done .mtg-text { text-decoration: line-through; color: #94a3b8; }
.mtg-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.05); }

/* Schedule item */
.schedule-item {
  background: white; border: 1px solid #e2e8f0;
  border-radius: 4px; padding: 14px 16px; margin-bottom: 10px;
  transition: all 0.15s;
}
.schedule-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); border-color: #c7d2fe; }

/* Memo note */
.memo-note {
  background: white; border: 1px solid #e2e8f0;
  border-radius: 4px; padding: 16px 18px;
  margin-bottom: 10px; transition: all 0.15s;
}
.memo-note:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); border-color: #c7d2fe; }

/* Day group header */
.day-group-header {
  padding: 7px 14px; margin-bottom: 8px;
  background: #f8fafc; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: #475569;
  border: 1px solid #f1f5f9;
  display: flex; align-items: center;
}

/* Fade in */
.fade-in { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }

/* Page header */
.page-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 24px;
}
.page-header-icon {
  width: 40px; height: 40px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Filter buttons */
.filter-btn {
  padding: 6px 16px; border-radius: 9999px;
  font-size: 13px; font-weight: 500;
  border: 1px solid #e2e8f0; cursor: pointer;
  transition: all 0.15s; background: white; color: #475569;
  font-family: inherit;
}
.filter-btn.active { background: #6366f1; color: white; border-color: #6366f1; }
.filter-btn:not(.active):hover { border-color: #c7d2fe; color: #4f46e5; }

/* Right panel wrapper */
.right-panel {
  padding: 18px 14px;
}
.right-panel-title {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Stat cards grid */
.rp-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.rp-stat-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 11px 10px 9px;
  transition: box-shadow 0.15s;
}
.rp-stat-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.rp-stat-label {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.rp-stat-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: #1e293b;
}
.rp-stat-sub {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 3px;
}

/* Generic right-panel section card */
.rp-section {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 13px 13px 8px;
  margin-bottom: 10px;
}
.rp-section-header {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 9px;
}

/* Task rows inside right panel */
.rp-task-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 0;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.1s;
}
.rp-task-row:last-child { border-bottom: none; }
.rp-task-row:hover { background: #f8fafc; border-radius: 6px; }
.rp-task-name {
  font-size: 12px;
  color: #334155;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rp-task-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.rp-task-project {
  font-size: 10px;
  color: #94a3b8;
  flex-shrink: 0;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Project rows inside right panel */
.rp-project-row {
  padding: 7px 0;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
}
.rp-project-row:last-child { border-bottom: none; }
.rp-project-row:hover { opacity: 0.8; }
.rp-project-name {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rp-progress-bar {
  height: 5px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}
.rp-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #6366f1, #818cf8);
  transition: width 0.3s;
}
.rp-progress-label {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 3px;
}

/* Schedule rows inside right panel */
.rp-sched-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid #f1f5f9;
}
.rp-sched-row:last-child { border-bottom: none; }
.rp-sched-date {
  font-size: 10px;
  font-weight: 700;
  color: #6366f1;
  flex-shrink: 0;
  min-width: 36px;
}
.rp-sched-name {
  font-size: 12px;
  color: #334155;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Empty state */
.rp-empty {
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  padding: 8px 0;
}

/* Progress bar in today's progress widget */
.rp-today-bar {
  height: 7px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin: 6px 0 10px;
}
.rp-today-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  border-radius: 4px;
  transition: width 0.4s;
}

/* Small outline button (used in page headers) */
.btn-sm-outline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid #d1d5db;
  background: white;
  color: #475569;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.btn-sm-outline:hover {
  border-color: #6366f1;
  color: #4f46e5;
  background: #f5f3ff;
}

/* =====================================================
   Status Picker dropdown
   ===================================================== */
.status-picker {
  position: fixed;
  z-index: 2000;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.06);
  padding: 6px;
  min-width: 160px;
  animation: fadeIn 0.12s ease;
}
.sp-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 3px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: #374151;
  text-align: left;
  transition: background 0.1s;
}
.sp-option:hover { background: #f1f5f9; }
.sp-active { background: #f5f3ff !important; color: #4f46e5 !important; }
.sp-icon { font-size: 11px; width: 14px; text-align: center; flex-shrink: 0; }
.sp-check { font-size: 10px; margin-left: auto; color: #6366f1; flex-shrink: 0; }

/* per-status accent colors in picker */
.sp-未着手 .sp-icon   { color: #64748b; }
.sp-進行中 .sp-icon   { color: #1d4ed8; }
.sp-対応待ち .sp-icon { color: #b45309; }
.sp-保留 .sp-icon     { color: #7e22ce; }
.sp-完了 .sp-icon     { color: #166534; }

/* =====================================================
   Review target badge (inside status button)
   ===================================================== */
.review-target-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  background: rgba(180,83,9,0.12);
  color: #92400e;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

/* Review target picker sub-panel */
.review-target-picker { min-width: 180px; }
.rtp-label {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.rtp-divider { height: 1px; background: #f1f5f9; margin: 4px 0; }
.rtp-skip { color: #94a3b8 !important; font-size: 12px !important; }
.rtp-skip .sp-icon { color: #94a3b8 !important; }

/* Review target radio buttons in modal */
.review-target-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 3px;
  border: 1.5px solid #e2e8f0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  transition: all 0.15s;
  background: white;
  user-select: none;
}
.review-target-radio:hover { border-color: #f59e0b; color: #92400e; background: #fffbeb; }
.review-target-radio input[type="radio"] { display: none; }
.review-target-radio:has(input:checked) {
  border-color: #f59e0b;
  background: #fef3c7;
  color: #92400e;
  font-weight: 700;
}

/* ==========================================
   OVERVIEW TAB
   ========================================== */
.ov-page-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 28px; padding: 20px 22px; background: white; border: 1px solid #e2e8f0; border-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.ov-header-left { display: flex; align-items: center; gap: 16px; }
.ov-avatar { width: 52px; height: 52px; border-radius: 4px; background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ov-avatar i { font-size: 22px; color: white; }
.ov-project-name { font-size: 20px; font-weight: 700; color: #1e293b; display: flex; align-items: center; gap: 8px; cursor: pointer; line-height: 1.3; }
.ov-project-name:hover .ov-name-edit-icon { opacity: 1; }
.ov-name-edit-icon { font-size: 12px; color: #94a3b8; opacity: 0; transition: opacity 0.15s; }
.ov-sub-info { display: flex; align-items: center; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.ov-company { font-size: 13px; font-weight: 600; color: #4f46e5; background: #eef2ff; padding: 2px 10px; border-radius: 20px; }
.ov-person { font-size: 13px; color: #64748b; }
.ov-header-meta { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
.ov-meta-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #94a3b8; }
.ov-section-title { font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.06em; display: flex; align-items: center; margin-bottom: 10px; margin-top: 24px; }
.ov-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ov-grid-1 { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (max-width: 640px) { .ov-grid-2 { grid-template-columns: 1fr; } }
.ov-field-card { background: white; border: 1px solid #e2e8f0; border-radius: 4px; padding: 13px 15px 11px; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; position: relative; }
.ov-field-card:hover { border-color: #c7d2fe; box-shadow: 0 2px 8px rgba(99,102,241,0.08); }
.ov-field-card:hover .ov-edit-btn { opacity: 1; }
.ov-field-header { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.ov-field-icon { width: 22px; height: 22px; border-radius: 2px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #6366f1; flex-shrink: 0; }
.ov-field-label { font-size: 11px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; flex: 1; }
.ov-edit-btn { width: 22px; height: 22px; border-radius: 2px; border: none; background: #f1f5f9; color: #94a3b8; font-size: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.15s, background 0.15s; }
.ov-edit-btn:hover { background: #e0e7ff; color: #4f46e5; }
.ov-field-value { padding-left: 2px; }
.ov-val { font-size: 14px; font-weight: 500; color: #1e293b; line-height: 1.5; word-break: break-all; }
.ov-empty { font-size: 13px; color: #cbd5e1; font-style: italic; }
.ov-link { font-size: 13px; color: #4f46e5; text-decoration: none; word-break: break-all; display: inline-flex; align-items: center; gap: 3px; }
.ov-link:hover { text-decoration: underline; color: #4338ca; }
.ov-textarea-val { font-size: 13px; color: #374151; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 200; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; }
.modal-title { font-size: 16px; font-weight: 700; color: #1e293b; }
.modal-close { width: 28px; height: 28px; border-radius: 6px; border: none; background: #f1f5f9; color: #64748b; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: #e2e8f0; }

/* ==========================================
   MEMO TAB — NEW TYPES
   ========================================== */
.memo-filter-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 20px; font-size: 12px; font-weight: 500; border: 1px solid #e2e8f0; background: white; color: #64748b; cursor: pointer; transition: all 0.15s; font-family: inherit; }
.memo-filter-btn:hover { border-color: #c7d2fe; color: #4f46e5; }
.memo-filter-btn.active { background: #eef2ff; color: #4f46e5; border-color: #c7d2fe; font-weight: 600; }
.memo-filter-cnt { background: #f1f5f9; color: #64748b; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 3px; }
.memo-filter-btn.active .memo-filter-cnt { background: #c7d2fe; color: #4338ca; }
.memo-contact-card { background: white; border: 1px solid #e2e8f0; border-radius: 4px; padding: 14px 16px; margin-bottom: 10px; transition: box-shadow 0.15s, border-color 0.15s; }
.memo-contact-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.07); border-color: #c7d2fe; }
.memo-contact-avatar { width: 36px; height: 36px; border-radius: 4px; background: linear-gradient(135deg, #6366f1, #818cf8); display: flex; align-items: center; justify-content: center; color: white; font-size: 14px; flex-shrink: 0; }
.memo-cat-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 3px; flex-shrink: 0; }
.memo-contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
@media (max-width: 480px) { .memo-contact-grid { grid-template-columns: 1fr; } }
.memo-contact-item { display: flex; align-items: center; gap: 6px; background: #f8fafc; border-radius: 3px; padding: 5px 9px; }
.memo-contact-icon { font-size: 11px; flex-shrink: 0; }
.memo-contact-val { font-size: 12px; color: #374151; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.memo-type-badge-other { display: inline-flex; align-items: center; font-size: 10px; font-weight: 700; background: #f1f5f9; color: #64748b; padding: 2px 7px; border-radius: 4px; flex-shrink: 0; }
.pmemo-type-btn { background: white; border: 1.5px solid #e2e8f0; border-radius: 4px; padding: 14px 16px; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; font-family: inherit; width: 100%; text-align: left; }
.pmemo-type-btn:hover { border-color: #c7d2fe; box-shadow: 0 2px 8px rgba(99,102,241,0.1); }
.pmemo-type-icon { width: 38px; height: 38px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }

/* completed task styles */
.status-完了 { background: #dcfce7; color: #166534; }
.sp-完了 .sp-icon { color: #166534; }
.completed-task-row { opacity: 0.85; }
.completed-check-icon { width: 22px; height: 22px; border-radius: 50%; background: #dcfce7; color: #16a34a; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* task inner filter tabs */
.task-filter-bar { display: flex; gap: 4px; margin-bottom: 18px; padding: 4px; background: #f1f5f9; border-radius: 4px; }
.task-filter-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 6px 10px; border-radius: 3px; font-size: 12px; font-weight: 500; color: #64748b; border: none; background: transparent; cursor: pointer; transition: all 0.15s; font-family: inherit; white-space: nowrap; }
.task-filter-tab:hover { background: white; color: #1e293b; }
.task-filter-tab.active { background: white; color: #4f46e5; font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.task-filter-cnt { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px; background: #e2e8f0; color: #64748b; }
.task-filter-cnt.active { background: #e0e7ff; color: #4338ca; }

/* sidebar quick-add button & task count badge */
.sidebar-task-cnt { font-size: 10px; font-weight: 700; background: #e0e7ff; color: #4338ca; padding: 1px 7px; border-radius: 3px; flex-shrink: 0; line-height: 1.5; }
.sidebar-item:hover .sidebar-task-cnt { display: none; }
.sidebar-quick-add { display: none; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 5px; background: transparent; border: 1.5px solid #c7d2fe; color: #6366f1; font-size: 11px; cursor: pointer; transition: background 0.15s, color 0.15s; flex-shrink: 0; padding: 0; font-family: inherit; }
.sidebar-item:hover .sidebar-quick-add { display: flex; }
.sidebar-quick-add:hover { background: #6366f1; color: white; border-color: #6366f1; }

/* ── サイドバー並べ替え ── */
.sidebar-drag-handle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 16px;
  flex-shrink: 0;
  color: #cbd5e1;
  font-size: 11px;
  cursor: grab;
  touch-action: none;
  padding: 2px 0;
}
.sidebar-drag-handle:active { cursor: grabbing; }
.sidebar-item:hover .sidebar-drag-handle { display: flex; }
/* ドラッグ中のアイテム（元位置）: 透明化 */
.sidebar-dragging {
  opacity: 0;
  pointer-events: none;
}
/* ドロップ先インジケーター */
.sidebar-drag-placeholder {
  background: #eef2ff;
  border: 2px dashed #a5b4fc;
  border-radius: 8px;
  margin: 2px 0;
  transition: none;
}

/* unassigned tasks section */
.unassigned-section { border: 1.5px dashed #fcd34d !important; background: #fffbeb !important; }
.unassigned-section .section-header { background: #fef9c3 !important; border-radius: 4px 4px 0 0; }

/* assign-to-parent button */
.assign-to-parent-btn { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; color: #d97706; background: #fef3c7; border: 1px solid #fde68a; border-radius: 6px; padding: 3px 8px; cursor: pointer; transition: background 0.15s, color 0.15s; font-family: inherit; white-space: nowrap; flex-shrink: 0; }
.assign-to-parent-btn:hover { background: #fbbf24; color: white; border-color: #fbbf24; }

/* assign parent overlay */
.assign-parent-btn { display: flex; align-items: center; width: 100%; background: white; border: 1.5px solid #e2e8f0; border-radius: 4px; padding: 12px 14px; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; font-family: inherit; gap: 4px; }
.assign-parent-btn:hover { border-color: #c7d2fe; box-shadow: 0 2px 8px rgba(99,102,241,0.1); background: #f5f3ff; }

/* ── View toggle buttons (list / calendar) ─────────────────────────── */
.view-toggle-btns { display: flex; background: #f1f5f9; border-radius: 4px; padding: 3px; gap: 2px; }
.view-toggle-btn { display: flex; align-items: center; justify-content: center; width: 30px; height: 28px; border: none; border-radius: 2px; background: transparent; color: #94a3b8; font-size: 13px; cursor: pointer; transition: background 0.15s, color 0.15s; }
.view-toggle-btn:hover { color: #475569; }
.view-toggle-btn.active { background: white; color: #4f46e5; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* ── Calendar wrap ──────────────────────────────────────────────────── */
.cal-wrap { background: white; border: 1px solid #e2e8f0; border-radius: 4px; overflow: hidden; margin-bottom: 20px; }
.cal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 10px; border-bottom: 1px solid #f1f5f9; }
.cal-month-label { font-size: 15px; font-weight: 700; color: #1e293b; }
.cal-nav-btn { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid #e2e8f0; border-radius: 8px; background: white; color: #64748b; font-size: 12px; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.cal-nav-btn:hover { background: #f8fafc; border-color: #c7d2fe; color: #4f46e5; }

/* ── Calendar grid (7列・旧) ─────────────────────────────────────── */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
/* ── Calendar grid (5列・月〜金) ──────────────────────────────────── */
.cal-grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); }
.cal-grid-5 .cal-cell:nth-child(5n) { border-right: none; }
.cal-grid-5 .cal-cell-empty:nth-child(5n) { border-right: none; }

.cal-dow { padding: 6px 0 5px; text-align: center; font-size: 10px; font-weight: 700; color: #94a3b8; background: #f8fafc; }
.cal-dow-sun { color: #f87171; }
.cal-dow-sat { color: #60a5fa; }

.cal-cell { min-height: 64px; padding: 4px 4px 3px; border-right: 1px solid #f1f5f9; border-bottom: 1px solid #f1f5f9; cursor: pointer; transition: background 0.1s; box-sizing: border-box; }
.cal-cell:hover { background: #f5f3ff; }
.cal-cell-empty { min-height: 64px; background: #fafafa; border-right: 1px solid #f1f5f9; border-bottom: 1px solid #f1f5f9; }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell-sun .cal-day-num { color: #f87171; }
.cal-cell-sat .cal-day-num { color: #60a5fa; }
.cal-cell-today { background: #eef2ff; }
.cal-cell-today .cal-day-num { background: #4f46e5; color: white; border-radius: 50%; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }

.cal-day-num { font-size: 11px; font-weight: 600; color: #374151; margin-bottom: 2px; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }

/* ── Dot items inside calendar cells ───────────────────────────────── */
.cal-dots { display: flex; flex-direction: column; gap: 1px; }
.cal-dot-item { font-size: 9px; font-weight: 500; padding: 1px 4px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; line-height: 1.4; }
.cal-dot-violet  { background: #ede9fe; color: #5b21b6; }
.cal-dot-blue    { background: #dbeafe; color: #1d4ed8; }
.cal-dot-green   { background: #dcfce7; color: #15803d; }
.cal-dot-red     { background: #fee2e2; color: #b91c1c; }
.cal-dot-default { background: #f1f5f9; color: #475569; }
.cal-dot-more    { background: #f1f5f9; color: #94a3b8; font-style: italic; }

/* ── Detail panel below calendar ───────────────────────────────────── */
.cal-day-detail { background: white; border: 1px solid #e2e8f0; border-radius: 4px; padding: 14px 16px; margin-top: 4px; }
.cal-day-detail-header { font-size: 13px; font-weight: 700; color: #1e293b; margin-bottom: 12px; display: flex; align-items: center; gap: 4px; }

/* ── Exec schedule page: 2-month calendar grid + list ── */
.exec-cal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 900px) { .exec-cal-grid { grid-template-columns: 1fr; } }
.exec-list-section { margin-top: 8px; }
.exec-list-title { font-size: 14px; font-weight: 700; color: #374151; margin-bottom: 16px; display: flex; align-items: center; }
.today-header { background: #ede9fe; color: #5b21b6; border-radius: 4px; padding: 6px 12px; }

/* ── Exec schedule: full-width single-month calendar ── */
.exec-cal-wrap { background: white; border: 1px solid #e2e8f0; border-radius: 4px; overflow: hidden; margin-bottom: 20px; }
.exec-cal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 12px; border-bottom: 1px solid #f1f5f9; }
.exec-cal-month { font-size: 17px; font-weight: 800; color: #1e293b; letter-spacing: 0.01em; }
.exec-cal-nav { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1.5px solid #e2e8f0; border-radius: 4px; background: white; color: #64748b; font-size: 13px; cursor: pointer; transition: all 0.15s; }
.exec-cal-nav:hover { background: #eef2ff; border-color: #a5b4fc; color: #4f46e5; }

.exec-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
/* ── Exec/Sched calendar: 5列（月〜金） ── */
.exec-cal-grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); }
.exec-cal-grid-5 > div:nth-child(5n) { border-right: none; }

.exec-cal-dow { padding: 7px 0 6px; text-align: center; font-size: 10px; font-weight: 700; color: #94a3b8; background: #f8fafc; }
.exec-dow-sun { color: #f87171; }
.exec-dow-sat { color: #60a5fa; }

.exec-cal-cell { min-height: 85px; padding: 5px 4px 4px; border-right: 1px solid #f1f5f9; border-bottom: 1px solid #f1f5f9; cursor: pointer; transition: background 0.12s; box-sizing: border-box; vertical-align: top; }
.exec-cal-cell:hover { background: #f5f3ff; }
.exec-cal-empty { min-height: 75px; background: #fafafa; border-right: 1px solid #f1f5f9; border-bottom: 1px solid #f1f5f9; cursor: default; }
.exec-cal-grid > div:nth-child(7n) { border-right: none; }
.exec-cell-sun .exec-day-num { color: #f87171; }
.exec-cell-sat .exec-day-num { color: #60a5fa; }
.exec-cell-today { background: #f5f3ff; }
.exec-cell-selected { background: #eef2ff; outline: 2px solid #6366f1; outline-offset: -2px; }

.exec-day-num { font-size: 11px; font-weight: 600; color: #374151; margin-bottom: 3px; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.exec-day-today { background: #4f46e5; color: white !important; }

.exec-cell-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.exec-cell-cnt { font-size: 9px; font-weight: 700; background: #e0e7ff; color: #4338ca; padding: 1px 4px; border-radius: 8px; line-height: 1.4; flex-shrink: 0; }
.exec-dots { display: flex; flex-direction: column; gap: 1px; }
.exec-dot-item { font-size: 9px; font-weight: 500; background: #ede9fe; color: #5b21b6; padding: 1px 5px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.exec-card-item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.exec-dot-more { font-size: 9px; font-weight: 600; color: #6366f1; padding: 1px 3px; }

/* ── 締切カレンダー ドット色 ── */
.dl-dot-over      { font-size: 9px; font-weight: 600; background: #fee2e2; color: #b91c1c; padding: 1px 5px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.dl-dot-soon      { font-size: 9px; font-weight: 600; background: #ffedd5; color: #c2410c; padding: 1px 5px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.dl-dot-normal    { font-size: 9px; font-weight: 500; background: #dbeafe; color: #1d4ed8; padding: 1px 5px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
/* カードカレンダー用 -pill バリアント（締切・実行日ページ共通） */
.dl-dot-over-pill   { font-size: 9px; font-weight: 600; background: #fee2e2; color: #b91c1c; padding: 1px 5px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; display: block; }
.dl-dot-soon-pill   { font-size: 9px; font-weight: 600; background: #ffedd5; color: #c2410c; padding: 1px 5px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; display: block; }
.dl-dot-normal-pill { font-size: 9px; font-weight: 500; background: #dbeafe; color: #1d4ed8; padding: 1px 5px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; display: block; }
.cal-dot-violet-pill { font-size: 9px; font-weight: 500; background: #ede9fe; color: #5b21b6; padding: 1px 5px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; display: block; }
/* 締切リスト グループヘッダー */
.dl-header-over { background: #fee2e2 !important; color: #b91c1c !important; border-radius: 8px; }
.dl-header-soon { background: #ffedd5 !important; color: #c2410c !important; border-radius: 8px; }

/* ── スケジュールカレンダー ドット色 ── */
.sched-dot-mtg-pill      { font-size: 9px; font-weight: 500; background: #dbeafe; color: #1d4ed8; padding: 1px 5px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.sched-dot-release-pill  { font-size: 9px; font-weight: 500; background: #dcfce7; color: #15803d; padding: 1px 5px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.sched-dot-dl-pill       { font-size: 9px; font-weight: 500; background: #fee2e2; color: #b91c1c; padding: 1px 5px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.sched-dot-other-pill    { font-size: 9px; font-weight: 500; background: #f1f5f9; color: #475569; padding: 1px 5px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }

/* ── Calendar Day Panel (.cdp-*) ── */
.cal-day-panel { display: flex; flex-direction: column; gap: 0; height: 100%; }

.cdp-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 12px; border-bottom: 1px solid #e2e8f0; flex-shrink: 0; }
.cdp-title { display: flex; align-items: center; font-size: 14px; font-weight: 600; color: #1e293b; flex: 1; min-width: 0; }
.cdp-today-badge { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 9999px; background: #4f46e5; color: white; font-size: 10px; font-weight: 600; flex-shrink: 0; }
.cdp-close { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; color: #94a3b8; background: transparent; border: none; cursor: pointer; flex-shrink: 0; transition: background 0.12s, color 0.12s; }
.cdp-close:hover { background: #f1f5f9; color: #475569; }

.cdp-empty { padding: 24px 16px; text-align: center; color: #94a3b8; font-size: 13px; }

.cdp-task-row { padding: 10px 16px; border-bottom: 1px solid #f1f5f9; cursor: pointer; transition: background 0.1s; display: flex; flex-direction: column; gap: 4px; }
.cdp-task-row:hover { background: #f8fafc; }
.cdp-task-main { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cdp-task-name { font-size: 13px; font-weight: 500; color: #1e293b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.cdp-proj-name { font-size: 11px; color: #94a3b8; padding-left: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ステータスバッジ */
.cdp-badge-todo { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 9999px; font-size: 10px; font-weight: 600; flex-shrink: 0; background: #f1f5f9; color: #475569; }
.cdp-badge-prog { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 9999px; font-size: 10px; font-weight: 600; flex-shrink: 0; background: #dbeafe; color: #1d4ed8; }
.cdp-badge-req  { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 9999px; font-size: 10px; font-weight: 600; flex-shrink: 0; background: #d1fae5; color: #065f46; }
.cdp-badge-fix  { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 9999px; font-size: 10px; font-weight: 600; flex-shrink: 0; background: #fee2e2; color: #991b1b; }
.cdp-badge-pend { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 9999px; font-size: 10px; font-weight: 600; flex-shrink: 0; background: #fef9c3; color: #a16207; }
.cdp-badge-done { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 9999px; font-size: 10px; font-weight: 600; flex-shrink: 0; background: #dcfce7; color: #15803d; }
.cdp-badge-mtg  { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 9999px; font-size: 10px; font-weight: 600; flex-shrink: 0; background: #ede9fe; color: #6d28d9; }
.cdp-badge-hold { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 9999px; font-size: 10px; font-weight: 600; flex-shrink: 0; background: #f3e8ff; color: #7e22ce; }

.cdp-sched-row { padding: 10px 16px; border-bottom: 1px solid #f1f5f9; display: flex; flex-direction: column; gap: 4px; }
.cdp-sched-memo { font-size: 12px; color: #64748b; background: #f8fafc; border-radius: 3px; padding: 6px 10px; margin-top: 2px; white-space: pre-wrap; }
.cdp-sched-actions { display: flex; gap: 6px; margin-top: 4px; }

/* ── Right Panel Timeline (.rpt-*) ── */
.rpt-panel { display: flex; flex-direction: column; gap: 0; min-height: 100%; }

.rpt-header { display: flex; align-items: center; padding: 14px 16px 12px; border-bottom: 2px solid #e2e8f0; flex-shrink: 0; gap: 4px; }
.rpt-title  { font-size: 13px; font-weight: 700; color: #1e293b; flex: 1; }
.rpt-add-btn { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: #f1f5f9; color: #64748b; border: none; cursor: pointer; transition: background 0.12s; flex-shrink: 0; }
.rpt-add-btn:hover { background: #e0e7ff; color: #4f46e5; }

.rpt-empty { padding: 24px 16px; text-align: center; color: #94a3b8; font-size: 13px; }

.rpt-group { border-bottom: 1px solid #f1f5f9; }

.rpt-day-header { display: flex; align-items: center; justify-content: space-between; padding: 7px 16px 5px; background: #f8fafc; }
.rpt-day-label  { font-size: 11px; font-weight: 700; color: #64748b; }
.rpt-day-count  { font-size: 10px; font-weight: 600; color: #94a3b8; }

.rpt-day-today .rpt-day-label { color: #4f46e5; }
.rpt-day-today  { background: #eef2ff; }
.rpt-day-past   { opacity: 0.55; }
.rpt-day-over   { background: #fff1f2; }
.rpt-day-over .rpt-day-label { color: #be123c; }
.rpt-day-soon   { background: #fff7ed; }
.rpt-day-soon .rpt-day-label { color: #c2410c; }
.rpt-day-none   { background: #f8fafc; }
.rpt-day-none .rpt-day-label { color: #94a3b8; }

.rpt-item { display: flex; flex-direction: column; border-bottom: 1px solid #f0f4f8; transition: background 0.1s; }
.rpt-item:last-child { border-bottom: none; }

/* トグル展開タスク行 */
.rpt-task-toggle { cursor: default; }
.rpt-task-toggle:hover { background: transparent; }
.rpt-task-expanded { background: #f8faff; }

.rpt-task-summary { display: flex; align-items: flex-start; gap: 7px; padding: 9px 14px 8px; cursor: pointer; transition: background 0.1s; border-radius: 6px; }
.rpt-task-summary:hover { background: #f0f4ff; }

.rpt-toggle-icon { display: flex; align-items: center; justify-content: center; width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; }

/* 展開詳細パネル */
.rpt-task-detail { padding: 0 14px 12px 14px; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid #e8edf5; background: #f8faff; margin: 0 6px; border-radius: 0 0 4px 4px; }
.rpt-detail-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 8px; }
.rpt-detail-label { font-size: 10px; color: #94a3b8; font-weight: 500; flex-shrink: 0; }
.rpt-detail-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rpt-detail-dates > div { display: flex; flex-direction: column; gap: 3px; }

/* 進捗メモ（展開パネル内） */
.rpt-detail-memos { display: flex; flex-direction: column; gap: 4px; }
.rpt-detail-memo-header { font-size: 10px; font-weight: 600; color: #6366f1; }
.rpt-memo-item { background: white; border: 1px solid #e2e8f0; border-radius: 6px; padding: 5px 8px; }
.rpt-memo-body { font-size: 11px; color: #374151; white-space: pre-wrap; word-break: break-all; }
.rpt-memo-date { font-size: 9px; color: #94a3b8; margin-top: 2px; }

/* 案件ジャンプボタン */
.rpt-jump-btn { display: inline-flex; align-items: center; font-size: 10px; font-weight: 500; color: #6366f1; background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 6px; padding: 2px 8px; cursor: pointer; transition: background 0.12s; }
.rpt-jump-btn:hover { background: #e0e7ff; }

/* メモ追加ボタン */
.rpt-memo-add-btn { display: inline-flex; align-items: center; font-size: 10px; font-weight: 500; color: #6366f1; background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 6px; padding: 3px 10px; cursor: pointer; transition: background 0.12s; }
.rpt-memo-add-btn:hover { background: #e0e7ff; }

.rpt-sched-item { cursor: default; padding: 8px 14px; }
.rpt-sched-item:hover { background: transparent; }

.rpt-item-body  { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.rpt-item-name  { font-size: 12px; font-weight: 500; color: #1e293b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rpt-item-proj  { font-size: 10px; color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rpt-item-memo  { font-size: 11px; color: #64748b; background: #f8fafc; border-radius: 5px; padding: 4px 8px; margin-top: 3px; white-space: pre-wrap; word-break: break-all; }
.rpt-item-actions { display: flex; gap: 4px; flex-shrink: 0; align-self: flex-start; margin-top: 1px; }

/* ── Schedule Calendar Cell (+ボタン) ── */
.sched-cal-cell { position: relative; }
.sched-cal-cell-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.sched-cal-add-btn {
  opacity: 0;
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  background: #e0e7ff; color: #4f46e5;
  border: none; cursor: pointer;
  font-size: 9px;
  transition: opacity 0.15s, background 0.12s;
  flex-shrink: 0;
}
.sched-cal-cell:hover .sched-cal-add-btn { opacity: 1; }
.sched-cal-add-btn:hover { background: #4f46e5; color: #fff; }

/* ── Schedule Linked Tasks (.slt-*) ── */
/* モーダル内チェックリスト */
.slt-list { max-height: 180px; overflow-y: auto; border: 1px solid #e2e8f0; border-radius: 4px; background: #fafafa; }
.slt-group-label { font-size: 10px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; padding: 6px 10px 3px; background: #f1f5f9; border-bottom: 1px solid #e2e8f0; }
.slt-row { display: flex; align-items: center; gap-8px; padding: 6px 10px; cursor: pointer; transition: background 0.1s; border-bottom: 1px solid #f1f5f9; gap: 8px; }
.slt-row:last-child { border-bottom: none; }
.slt-row:hover { background: #f0f4ff; }
.slt-check { width: 14px; height: 14px; flex-shrink: 0; accent-color: #4f46e5; cursor: pointer; }
.slt-task-name { font-size: 12px; color: #374151; flex: 1; min-width: 0; }
.slt-dl { display: inline-block; margin-left: 5px; font-size: 10px; font-weight: 600; color: #c2410c; background: #fff7ed; padding: 0 5px; border-radius: 9999px; }

/* 表示側（scheduleItemHTML / rpTimeline / cdp）の紐づけブロック */
.slt-linked-block { margin-top: 6px; border-top: 1px dashed #e2e8f0; padding-top: 5px; }
.slt-linked-label { font-size: 10px; font-weight: 700; color: #a5b4fc; margin-bottom: 3px; letter-spacing: 0.03em; }
.slt-linked-row { display: flex; align-items: center; gap: 5px; padding: 3px 0; cursor: pointer; }
.slt-linked-row:hover .slt-linked-name { text-decoration: underline; }
.slt-linked-name { font-size: 11px; color: #475569; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── slt inline new-task form ── */
.slt-new-form { background: #f0f4ff; border: 1px solid #c7d2fe; border-radius: 4px; padding: 10px 12px; margin-bottom: 6px; }
.inp-sm { padding: 4px 8px; font-size: 12px; }

/* ── 場所バッジ（スケジュール） ── */
.sched-loc-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 600; padding: 1px 8px; border-radius: 9999px; flex-shrink: 0; }
.sched-site-detail { font-size: 11px; color: #15803d; background: #f0fdf4; border-radius: 6px; padding: 4px 8px; margin-top: 3px; white-space: pre-wrap; word-break: break-all; }
.sched-loc-online { background: #dbeafe; color: #1d4ed8; }
.sched-loc-mtg    { background: #fef9c3; color: #854d0e; }
.sched-loc-site   { background: #dcfce7; color: #166534; }
.sched-loc-none   { background: #f1f5f9; color: #64748b; }

/* ── 設定ページ ── */
.settings-section { background: white; border: 1px solid #e2e8f0; border-radius: 4px; padding: 20px 24px; margin-bottom: 20px; }
.settings-section-title { font-size: 14px; font-weight: 700; color: #1e293b; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.settings-type-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid #e2e8f0; border-radius: 3px; background: #f8fafc; margin-bottom: 6px; cursor: grab; }
.settings-type-name { flex: 1; font-size: 13px; color: #334155; }
.settings-type-drag { color: #94a3b8; font-size: 12px; }
.settings-add-row { display: flex; gap: 8px; margin-top: 10px; }
.settings-custom-field-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 3px; background: #f8fafc; margin-bottom: 6px; }
.settings-custom-field-label { flex: 1; font-size: 13px; color: #334155; }
.settings-nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 4px; cursor: pointer; transition: background 0.15s; font-size: 13px; color: #475569; font-weight: 500; }
.settings-nav-item:hover { background: #f1f5f9; }
.settings-nav-item.active { background: #ede9fe; color: #4f46e5; font-weight: 700; }

/* ── 明日ボタン（今日ページ） ── */
.exec-tomorrow-btn {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 600;
  background: #f0f4ff; color: #4338ca;
  border: 1.5px solid #a5b4fc; border-radius: 8px;
  padding: 2px 9px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap; font-family: inherit;
}
.exec-tomorrow-btn:hover { background: #e0e7ff; border-color: #818cf8; }

/* ── 今日ページ: インライン作業時間タグ行 ── */
.today-timetag-row {
  display: flex; align-items: center; gap: 5px;
  flex-wrap: wrap;
  margin-top: 6px;
  padding: 5px 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 3px;
}
.today-timetag-label {
  font-size: 10px; font-weight: 700;
  color: #94a3b8; white-space: nowrap;
  flex-shrink: 0;
}
.today-timetag-btn {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 600;
  background: #f1f5f9; color: #64748b;
  border: 1.5px solid #e2e8f0; border-radius: 3px;
  padding: 2px 8px; cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap; font-family: inherit;
}
.today-timetag-btn:hover { background: #e2e8f0; border-color: #cbd5e1; }
.today-timetag-btn.active {
  background: #eef2ff; color: #4338ca;
  border-color: #818cf8;
}
.today-timetag-clear {
  color: #94a3b8; border-style: dashed;
}
.today-timetag-clear.active {
  background: #f8fafc; color: #94a3b8;
  border-color: #cbd5e1;
}

/* ── Google Drive 同期セクション ── */
.gdrive-status-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: #f8fafc;
  border: 1px solid #e2e8f0; border-radius: 4px;
  margin-bottom: 14px;
}
.gdrive-status-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.gdrive-connected    { background: #dcfce7; color: #16a34a; }
.gdrive-disconnected { background: #f1f5f9; color: #94a3b8; }
.gdrive-status-info  { flex: 1; min-width: 0; }
.gdrive-status-text  { font-size: 13px; font-weight: 600; color: #1e293b; word-break: break-all; }
.gdrive-status-sub   { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.gdrive-autosave-label { font-size: 11px; color: #16a34a; margin-top: 2px; font-weight: 500; }

.gdrive-btn-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 12px;
}
.gdrive-signin-btn { gap: 6px; }

.btn-gdrive-save {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px;
  background: #1a73e8; color: white;
  font-size: 13px; font-weight: 600;
  border: none; cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
.btn-gdrive-save:hover:not(:disabled) { background: #1557b0; }
.btn-gdrive-save:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-gdrive-load {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px;
  background: #f1f8ff; color: #1a73e8;
  font-size: 13px; font-weight: 600;
  border: 1.5px solid #93c5fd; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-family: inherit;
}
.btn-gdrive-load:hover:not(:disabled) { background: #dbeafe; border-color: #60a5fa; }
.btn-gdrive-load:disabled { opacity: 0.4; cursor: not-allowed; }

.gdrive-signout-btn {
  font-size: 12px;
  padding: 6px 12px;
}

.gdrive-note {
  font-size: 11px; color: #94a3b8;
  background: #f8fafc; border-radius: 8px;
  padding: 8px 12px; margin-top: 4px;
  line-height: 1.6;
}

/* ── 親タスク：全子完了時のハイライト ── */
.complete-parent-ready { box-shadow: 0 0 0 0 rgba(16,185,129,0.7); }
@keyframes completePulse {
  0%   { box-shadow: 0 0 0 0 rgba(16,185,129,0.6); }
  60%  { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* ── 繰り返しタスク ── */
.repeat-task-row {
  border-left: 3px solid #8b5cf6;
  background: linear-gradient(to right, #faf5ff 0%, #ffffff 60px);
}
.repeat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: #8b5cf6;
  color: #fff;
  border-radius: 50%;
  font-size: 8px;
  flex-shrink: 0;
}
/* 繰り返しパターンボタン */
.repeat-pattern-btn {
  padding: 5px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
  cursor: pointer;
  transition: all .15s;
}
.repeat-pattern-btn.active {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
}
.repeat-pattern-btn:hover:not(.active) {
  border-color: #7c3aed;
  color: #7c3aed;
}
/* 曜日・日付選択ボタン */
.repeat-day-btn {
  width: 34px;
  height: 34px;
  border: 1.5px solid #e2e8f0;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
  cursor: pointer;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.repeat-day-btn.active {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
}
.repeat-day-btn:hover:not(.active) {
  border-color: #7c3aed;
  color: #7c3aed;
}

/* ── プロジェクトタスクカードの実行日行 ── */
.proj-exec-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  flex-wrap: wrap;
  min-height: 24px;
}
.proj-exec-divider {
  color: #cbd5e1;
  font-size: 11px;
  user-select: none;
  margin: 0 1px;
}
/* ── 実行日ボタン ── */
.proj-exec-btn {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid;
  transition: all .15s;
  line-height: 1.6;
}
.proj-exec-btn.today-btn {
  color: #d97706;
  border-color: #fde68a;
  background: #fffbeb;
}
.proj-exec-btn.today-btn:hover {
  background: #fef3c7;
  border-color: #f59e0b;
}
.proj-exec-btn.tom-btn {
  color: #4f46e5;
  border-color: #c7d2fe;
  background: #eef2ff;
}
.proj-exec-btn.tom-btn:hover {
  background: #e0e7ff;
  border-color: #6366f1;
}
.proj-exec-btn.clear-btn {
  color: #94a3b8;
  border-color: #e2e8f0;
  background: #f8fafc;
}
.proj-exec-btn.clear-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #ef4444;
}
/* ── 実行日バッジ ── */
.proj-exec-set {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  border: 1.5px solid;
}
/* 未設定: 目立つグレー */
.proj-exec-set.unset {
  background: #f1f5f9;
  color: #94a3b8;
  border-color: #e2e8f0;
}
/* 今日: 強調オレンジ */
.proj-exec-set.today {
  background: #fef3c7;
  color: #b45309;
  border-color: #fcd34d;
}
/* 明日: 青紫 */
.proj-exec-set.tomorrow {
  background: #eef2ff;
  color: #4338ca;
  border-color: #c7d2fe;
}
/* その他の未来日: 青緑 */
.proj-exec-set.other {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}
/* 過去日: 赤（期限切れ） */
.proj-exec-set.past {
  background: #fff1f2;
  color: #be123c;
  border-color: #fecdd3;
}

/* ==========================================
   PHASE BADGE & INPUT
   ========================================== */

/* タスクカード・今日ページのフェーズバッジ */
.phase-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 9999px;
  background: #ede9fe;
  color: #6d28d9;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #ddd6fe;
  white-space: nowrap;
  flex-shrink: 0;
}

/* 今日ページ用（少し小さめ） */
.phase-badge-sm {
  font-size: 10px;
  padding: 1px 6px;
}

/* フェーズ入力ラッパー */
.phase-input-wrap {
  position: relative;
}

.phase-input-inner {
  position: relative;
}

.phase-text-input {
  width: 100%;
}

/* サジェストドロップダウン */
.phase-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  z-index: 600;
  overflow: hidden;
}

.phase-sug-item {
  display: flex;
  align-items: center;
  padding: 9px 12px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  transition: background 0.1s;
}

.phase-sug-item:hover {
  background: #f5f3ff;
  color: #6d28d9;
}

.phase-sug-item:not(:last-child) {
  border-bottom: 1px solid #f1f5f9;
}

/* ── globalTaskRow: フェーズセレクト ── */
.gtr-phase-select {
  appearance: none;
  -webkit-appearance: none;
  /* 左: レイヤーアイコン  右: ▼ドロップダウン矢印 */
  background:
    #f5f3ff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512' width='11' height='11'%3E%3Cpath fill='%238b5cf6' d='M288 0L0 160l288 160 288-160L288 0zM0 320l288 160 288-160-52.7-29.3L288 400 52.7 290.7 0 320zm0 96l288 160 288-160-52.7-29.3L288 496 52.7 386.7 0 416z'/%3E%3C/svg%3E")
    no-repeat left 8px center,
    #f5f3ff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b5cf6'/%3E%3C/svg%3E")
    no-repeat right 7px center;
  background-size: 10px, 8px;
  border: 1px solid #ddd6fe;
  border-radius: 9999px;
  color: #6d28d9;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 22px 2px 24px;
  cursor: pointer;
  outline: none;
  transition: background-color 0.15s, border-color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.gtr-phase-select:hover {
  background-color: #ede9fe !important;
  border-color: #c4b5fd;
  /* hover時もアイコンを維持 */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512' width='11' height='11'%3E%3Cpath fill='%238b5cf6' d='M288 0L0 160l288 160 288-160L288 0zM0 320l288 160 288-160-52.7-29.3L288 400 52.7 290.7 0 320zm0 96l288 160 288-160-52.7-29.3L288 496 52.7 386.7 0 416z'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b5cf6'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: left 8px center, right 7px center;
  background-size: 10px, 8px;
}
.gtr-phase-select option {
  color: #1e293b;
  font-weight: 400;
  background: #fff;
}

/* ── フェーズボタン（カスタムピッカー版） ── */
.phase-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 8px;
  border-radius: 9999px;
  border: 1px solid #ddd6fe;
  background: #f5f3ff;
  color: #6d28d9;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: filter 0.12s, border-color 0.12s;
  line-height: 1;
}
.phase-btn:hover { filter: brightness(0.95); }
/* フェーズ設定済み: インラインstyleで色が上書きされる */
.phase-btn-set {
  border-width: 1.5px;
}
.phase-btn-caret {
  font-size: 8px;
  opacity: 0.6;
  flex-shrink: 0;
}

/* ── フェーズピッカーパネル ── */
.phase-picker {
  position: fixed;
  z-index: 2000;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.06);
  padding: 6px;
  min-width: 192px;
  animation: fadeIn 0.12s ease;
}
.ph-opt { /* sp-option と共通スタイルを継承 */ }
.ph-opt-clear .sp-icon { color: #94a3b8; }

/* ── 実行日リセット確認ダイアログ ── */
.exec-reset-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15,23,42,0.45);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.15s ease;
}
.exec-reset-box {
  background: white; border-radius: 6px;
  padding: 28px 28px 24px;
  width: 340px; max-width: calc(100vw - 32px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  text-align: center;
  animation: slideUp 0.18s ease;
}
.exec-reset-icon {
  width: 48px; height: 48px; border-radius: 4px;
  background: #fef3c7; color: #d97706;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin: 0 auto 14px;
}
.exec-reset-title {
  font-size: 15px; font-weight: 700;
  color: #1e293b; margin: 0 0 8px;
}
.exec-reset-sub {
  font-size: 13px; color: #64748b;
  line-height: 1.6; margin: 0 0 20px;
}
.exec-reset-btns {
  display: flex; flex-direction: column; gap: 8px;
}
.exec-reset-btn-yes {
  padding: 10px 16px; border-radius: 4px; border: none;
  background: #f59e0b; color: white;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 0.15s;
}
.exec-reset-btn-yes:hover { background: #d97706; }
.exec-reset-btn-no {
  padding: 10px 16px; border-radius: 4px;
  border: 1.5px solid #e2e8f0; background: white;
  color: #475569; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all 0.15s;
}
.exec-reset-btn-no:hover { border-color: #94a3b8; background: #f8fafc; }

/* ── タスクD&Dハンドル ──────────────────────────────────────── */
.task-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #cbd5e1;
  cursor: grab;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  font-size: 11px;
  line-height: 1;
}
.task-drag-handle:hover { color: #94a3b8; background: #f1f5f9; }
.task-drag-handle:active { cursor: grabbing; }

/* 親タスク（グループ）ハンドル */
.parent-drag-handle {
  margin-right: 4px;
  font-size: 12px;
}

/* 子タスクハンドル */
.child-drag-handle {
  margin-right: 2px;
}

/* 親タスクドラッグ中のプレースホルダー */
.parent-drag-placeholder {
  background: #eef2ff;
  border: 2px dashed #a5b4fc;
  border-radius: 4px;
  margin-bottom: 12px;
  opacity: 0.7;
  transition: height 0.1s;
}

/* 子タスクドラッグ中のプレースホルダー */
.child-drag-placeholder {
  background: #eef2ff;
  border: 2px dashed #a5b4fc;
  border-radius: 4px;
  margin: 0 12px 8px;
  opacity: 0.7;
}

/* ── MTGタブ 進捗メモパネル ──────────────────────────────────── */
.mtg-item { align-items: flex-start; }

.mtg-memo-list {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mtg-memo-item {
  background: #f8fafc;
  border-radius: 6px;
  padding: 6px 10px;
  border-left: 2px solid #a5b4fc;
}
.mtg-memo-input-row {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.mtg-memo-input {
  flex: 1;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  color: #334155;
  outline: none;
  transition: border-color 0.15s;
}
.mtg-memo-input:focus { border-color: #818cf8; }
.mtg-memo-save-btn {
  padding: 5px 10px;
  background: #6366f1;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.mtg-memo-save-btn:hover { background: #4f46e5; }

/* ── MTGタブバッジ ───────────────────────────────────────────── */
.mtg-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: 5px;
  background: #6366f1;
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  line-height: 1;
  vertical-align: middle;
}
.mtg-tab-has-items {
  color: #4f46e5 !important;
  font-weight: 600 !important;
}
.mtg-tab-has-items .fa-comments {
  color: #6366f1;
}

/* ══════════════════════════════════════════
   カンバンビュー
══════════════════════════════════════════ */
.kanban-outer {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ツールバー（フィルター + 列追加ボタン） */
.kanban-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px 10px;
  flex-shrink: 0;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

/* ボード本体：横スクロール */
.kanban-board {
  display: flex;
  flex-direction: row;
  gap: 14px;
  padding: 16px 20px 24px;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  align-items: flex-start;
}
.kanban-board::-webkit-scrollbar { height: 6px; }
.kanban-board::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 3px; }
.kanban-board::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* 列 */
.kanban-col {
  width: 280px;
  min-width: 280px;
  max-width: 280px;
  background: #f1f5f9;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  max-height: 100%;
  flex-shrink: 0;
  border: 1.5px solid #e2e8f0;
}
.kanban-col-done {
  opacity: 0.75;
}

/* 列ヘッダー */
.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px 8px 10px;
  flex-shrink: 0;
}
.kanban-col-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}
.kanban-col-icon {
  width: 22px;
  height: 22px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
}
.kanban-col-name {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kanban-col-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.kanban-col-cnt {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  background: #e2e8f0;
  border-radius: 999px;
  padding: 1px 7px;
  margin-right: 4px;
}
.kanban-col-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #94a3b8;
  transition: background 0.15s, color 0.15s;
}
.kanban-col-btn:hover { background: #e2e8f0; color: #475569; }

/* プログレスバー */
.kanban-progress {
  height: 3px;
  background: #e2e8f0;
  border-radius: 0;
  margin: 0 10px 6px;
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}
.kanban-progress-bar {
  height: 100%;
  background: #818cf8;
  border-radius: 999px;
  transition: width 0.3s;
}
.kanban-progress-bar.done { background: #34d399; }

/* カード一覧（縦スクロール） */
.kanban-cards {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.kanban-cards::-webkit-scrollbar { width: 4px; }
.kanban-cards::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

/* 列が空のとき */
.kanban-empty-col {
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
  padding: 12px 0;
}

/* カード */
.kanban-card {
  background: white;
  border-radius: 4px;
  padding: 10px 10px 8px;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: box-shadow 0.15s, border-color 0.15s;
  cursor: default;
}
.kanban-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.09);
  border-color: #c7d2fe;
}
.kanban-card-done {
  background: #f8fafc;
  border-color: #e2e8f0;
  opacity: 0.7;
  padding: 8px 10px;
}
.kanban-card-waiting {
  background: #fffbeb !important;
  border-color: #fcd34d !important;
}
.kanban-card-priority {
  background: #fff5f5 !important;
  border-color: #fca5a5 !important;
}

/* カードヘッダー */
.kanban-card-header {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 6px;
}
.kanban-card-name-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.kanban-card-name {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.4;
  word-break: break-all;
}
.kanban-card-parent-name {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 500;
  color: #94a3b8;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kanban-card-parent-name i {
  font-size: 9px;
  flex-shrink: 0;
}
.kanban-card-actions {
  display: flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}
.kanban-card:hover .kanban-card-actions { opacity: 1; }
.kanban-card-btn {
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #94a3b8;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.kanban-card-btn:hover { background: #f1f5f9; }
.kanban-memo-cnt {
  position: absolute;
  top: -3px;
  right: -3px;
  background: #6366f1;
  color: white;
  font-size: 9px;
  font-weight: 700;
  border-radius: 999px;
  min-width: 13px;
  height: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  line-height: 1;
}

/* バッジ行 */
.kanban-card-badges {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}

/* フッター行（締切・実行日） */
.kanban-card-footer {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.kanban-footer-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

/* 完了カードの取り消しボタン */
.kanban-card-undo {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 10px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.kanban-card-undo:hover { color: #6366f1; }

/* 空ボード */
.kanban-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 300px;
}

/* カンバン用D&Dハンドルの調整 */
.kanban-card .child-drag-handle {
  margin-top: 1px;
}
.kanban-board .parent-drag-placeholder {
  width: 280px;
  min-width: 280px;
  height: 120px;
  border-radius: 4px;
  margin-bottom: 0;
  flex-shrink: 0;
}
.kanban-board .child-drag-placeholder {
  margin: 0;
  height: 60px;
  border-radius: 4px;
}

/* ── カンバンカード 実行日ボタン ─────────────────────────────── */
.kanban-exec-btn {
  display: inline-flex;
  align-items: center;
  border: none;
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  line-height: 1.6;
}
.kanban-exec-btn.today-btn  { background: #fef9c3; color: #ca8a04; }
.kanban-exec-btn.today-btn:hover  { background: #fde047; }
.kanban-exec-btn.tom-btn    { background: #ede9fe; color: #7c3aed; }
.kanban-exec-btn.tom-btn:hover    { background: #ddd6fe; }

/* 設定済み実行日（×解除ボタン付き） */
.kanban-exec-set {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.kanban-exec-clear {
  border: none;
  background: transparent;
  cursor: pointer;
  color: inherit;
  opacity: 0.5;
  font-size: 9px;
  padding: 0 1px;
  line-height: 1;
  transition: opacity 0.15s;
}
.kanban-exec-clear:hover { opacity: 1; }

/* ── カンバンカード 締切日インラインピッカー ─────────────────── */
.kanban-dl-unset {
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.kanban-dl-unset:hover {
  background: #e0e7ff !important;
  color: #4338ca !important;
  border-color: #a5b4fc !important;
}
.kanban-dl-set {
  cursor: pointer;
}
.kanban-dl-picker {
  position: fixed;
  z-index: 9999;
  background: white;
  border: 1.5px solid #e2e8f0;
  border-radius: 4px;
  padding: 12px 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 200px;
}
.kanban-dl-picker-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 8px;
}
.kanban-dl-picker-input {
  width: 100%;
  border: 1.5px solid #e2e8f0;
  border-radius: 3px;
  padding: 6px 10px;
  font-size: 13px;
  color: #1e293b;
  outline: none;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}
.kanban-dl-picker-input:focus { border-color: #818cf8; }
.kanban-dl-picker-btns {
  display: flex;
  gap: 6px;
}
.kanban-dl-save-btn {
  flex: 1;
  padding: 6px 0;
  background: #6366f1;
  color: white;
  border: none;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.kanban-dl-save-btn:hover { background: #4f46e5; }
.kanban-dl-clear-btn {
  padding: 6px 10px;
  background: white;
  color: #94a3b8;
  border: 1.5px solid #e2e8f0;
  border-radius: 3px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.kanban-dl-clear-btn:hover { border-color: #fca5a5; color: #ef4444; }

/* ── カンバン 実行日ピッカー ─────────────────────────────────── */
.kanban-exec-unset {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  background: #f1f5f9;
  color: #94a3b8;
  border: 1.5px solid #e2e8f0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-size: 10px;
  font-weight: 500;
}
.kanban-exec-unset:hover {
  background: #e0e7ff;
  color: #4338ca;
  border-color: #a5b4fc;
}
.kanban-exec-badge { cursor: pointer; }

/* 今日・明日クイックボタン行 */
.kanban-exec-quick {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.kanban-exec-quick-btn {
  flex: 1;
  padding: 5px 0;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.kanban-exec-quick-btn.today-btn { background: #fef9c3; color: #ca8a04; }
.kanban-exec-quick-btn.today-btn:hover { background: #fde047; }
.kanban-exec-quick-btn.tom-btn   { background: #ede9fe; color: #7c3aed; }
.kanban-exec-quick-btn.tom-btn:hover   { background: #ddd6fe; }

/* Keep memo counts visible even when other card actions are hidden. */
.kanban-card-actions { opacity: 1; }
.kanban-card-actions > :not(.has-memos) { opacity: 0; }
.kanban-card:hover .kanban-card-actions > *,
.kanban-card:focus-within .kanban-card-actions > * { opacity: 1; }
.progress-memo-trigger { position: relative; flex-shrink: 0; color: #818cf8; }
.progress-memo-trigger.has-memos { color: #6366f1; background: #eef2ff; }
.progress-memo-trigger:focus-visible { outline: 2px solid #6366f1; outline-offset: 3px; }
.progress-memo-preview {
  z-index: 10000; background: #fff; color: #334155;
  border: 1px solid #e2e8f0; border-radius: 8px; padding: 14px;
  box-shadow: 0 6px 24px rgba(15,23,42,.18); text-align: left;
}
.memo-preview-heading { font-size: 12px; font-weight: 700; color: #6366f1; margin-bottom: 10px; }
.memo-preview-heading span { margin-left: 6px; }
.memo-preview-entry + .memo-preview-entry { border-top: 1px solid #e2e8f0; padding-top: 10px; margin-top: 10px; }
.memo-preview-body { font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.memo-preview-date { display: block; margin-top: 5px; font-size: 10px; color: #94a3b8; }
@media (hover: none) { .kanban-card-actions > :not(.has-memos) { opacity: 1; } }

/* Cloud sign-in and account status, including iPad safe areas. */
body.cloud-boot:not(.cloud-active) #app-shell,
body.cloud-boot:not(.cloud-active) #mobile-header { visibility: hidden !important; }
#cloud-gate { position: fixed; inset: 0; z-index: 20000; display: grid; place-items: center; padding: 24px; background: #f8fafcee; overflow: auto; }
#cloud-gate[hidden] { display: none; }
.cloud-gate-card { width: 100%; max-width: 480px; padding: 32px; border-radius: 18px; border: 1px solid #e2e8f0; background: white; box-shadow: 0 12px 48px #0f172a18; }
.cloud-logo { color: #6366f1; font-size: 22px; font-weight: 800; margin-bottom: 24px; }
.cloud-gate-card h1 { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.cloud-gate-card p { color: #64748b; line-height: 1.8; font-size: 14px; }
.cloud-gate-actions { margin-top: 24px; display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
#cloud-account-bar { height: 44px; display: flex; gap: 12px; align-items: center; padding: 0 16px; background: #eef2ff; border-bottom: 1px solid #c7d2fe; font-size: 12px; }
.cloud-account-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 230px; }
#cloud-status { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #15803d; }
#cloud-status.cloud-error { color: #b91c1c; }
#cloud-account-bar button { flex-shrink: 0; min-height: 36px; color: #4338ca; }
.cloud-active #app-shell, .cloud-active #sidebar, .cloud-active #main-content, .cloud-active #right-panel-col { height: calc(100dvh - 44px); }
@media(max-width:767px) {
  #cloud-account-bar { gap: 8px; padding: 0 8px; }
  .cloud-account-email { display: none; }
  .cloud-active #mobile-header { top: 44px; }
  .cloud-active #sidebar { top: 44px; }
}
@media(hover:none) {
  .kanban-card-btn, .progress-memo-trigger { min-width: 32px; min-height: 36px; }
  .kanban-card-actions { flex-wrap: wrap; max-width: 100px; }
  .progress-memo-preview button { min-height: 44px; margin: 12px 8px 0 0; }
}

/* Compact arrows straddle the parent heading without moving task cards. */
.parent-sort-header {
  position: relative;
  padding-left: 18px;
  padding-right: 18px;
  z-index: 2;
}
.parent-move-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.parent-move-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #b8c5d3;
  border-radius: 50%;
  background: #cbd5e1;
  color: #334155;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  box-shadow: 0 2px 5px #0f172a12;
}
.parent-move-btn[data-move="-1"] { left: -14px; }
.parent-move-btn[data-move="1"] { right: -14px; }
.parent-move-btn:hover:not(:disabled) { background: #c7d2fe; color: #4338ca; border-color: #a5b4fc; }
.parent-move-btn:focus-visible { outline: 2px solid #6366f1; outline-offset: 2px; }
.parent-move-btn:disabled { opacity: .4; cursor: default; }
@media (hover: hover) and (pointer: fine) {
  .parent-move-controls { opacity: 0; }
  .parent-move-btn { pointer-events: none; }
  .parent-sort-header:hover > .parent-move-controls,
  .parent-sort-header:focus-within > .parent-move-controls { opacity: 1; }
  .parent-sort-header:hover > .parent-move-controls > .parent-move-btn,
  .parent-sort-header:focus-within > .parent-move-controls > .parent-move-btn { pointer-events: auto; }
}
@media (hover: none), (pointer: coarse) {
  .kanban-board:has(.parent-sort-header) { gap: 40px; padding-left: 24px; padding-right: 24px; }
  .parent-sort-header { padding-left: 22px; padding-right: 22px; min-height: 44px; }
  .parent-move-btn { width: 36px; height: 36px; }
  .parent-move-btn[data-move="-1"] { left: -18px; }
  .parent-move-btn[data-move="1"] { right: -18px; }
}

/* Task bulk editing */
.bulk-task-check { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-width: 24px; min-height: 24px; cursor: pointer; }
.bulk-task-check input { width: 16px; height: 16px; accent-color: #6366f1; cursor: pointer; }
.bulk-selected { outline: 2px solid #818cf8; outline-offset: -2px; }
.bulk-toolbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:8px 16px; background:#eef2ff; border-bottom:1px solid #e0e7ff; flex-shrink:0; font-size:12px; }
.bulk-toolbar button { padding:6px 10px; border-radius:6px; background:white; color:#4338ca; min-height:32px; }
.bulk-toolbar .bulk-primary { background:#6366f1; color:white; }
.bulk-toolbar small { color:#64748b; margin-left:auto; }
.bulk-modal { max-width:520px; padding:24px; max-height:90dvh; overflow-y:auto; }
.bulk-modal h2 { font-size:18px; font-weight:700; margin-bottom:8px; }
.bulk-modal p { font-size:12px; color:#64748b; margin:8px 0; }
.bulk-modal details { font-size:12px; margin:12px 0; }
.bulk-modal ul { max-height:120px; overflow:auto; padding-left:20px; list-style:disc; }
.bulk-field { display:grid; grid-template-columns: 1fr 1.2fr; gap:12px; align-items:center; margin:12px 0; font-size:13px; }
.bulk-field input[type=checkbox] { accent-color:#6366f1; }
.bulk-field .inp:disabled { opacity:.4; background:#f1f5f9; }
.bulk-modal-actions { display:flex; justify-content:flex-end; gap:12px; margin-top:16px; }
#bulk-error { color:#dc2626; }
@media (pointer:coarse) { .bulk-task-check { min-width:36px; min-height:36px; } .bulk-toolbar button { min-height:44px; } }
@media (max-width:480px) { .bulk-field { grid-template-columns:1fr; gap:4px; } .bulk-toolbar small { width:100%; margin-left:0; } }
