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

:root {
  --bg: #eef0f5;
  --surface: #ffffff;
  --border: #e2e5ec;
  --text: #1e2433;
  --muted: #8b92a5;
  --accent: #4A90D9;
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .08);
  --shadow: 0 4px 12px rgba(0, 0, 0, .10);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, .18);
  --col-w: 290px;
  --header-h: 58px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* =============================================
   ヘッダー
   ============================================= */
.app-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: var(--shadow-sm);
}

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

.header-icon {
  font-size: 20px;
}

.app-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.3px;
}

/* =============================================
   ボード
   ============================================= */
.board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  align-items: start;
  gap: 20px;
  padding: 24px;
  min-height: calc(100vh - var(--header-h));
}

.board-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  padding: 60px 0;
  width: 100%;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =============================================
   プロジェクト列
   ============================================= */
.project-col {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  max-height: calc(100vh - var(--header-h) - 44px);
  border: 1px solid var(--border);
  transition: box-shadow .2s, transform .2s;
  animation: fadeIn 0.4s ease-out backwards;
  overflow: hidden;
}

.project-col:hover {
  box-shadow: var(--shadow);
}

/* スライドアニメーション用のラッパー */
.project-collapsible-content {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.3s ease-out, opacity 0.2s;
  overflow: hidden;
  flex: 1;
}

.project-collapsible-content > div,
.project-collapsible-content > button {
  min-height: 0;
}

.project-col.collapsed .project-collapsible-content {
  grid-template-rows: 0fr;
  opacity: 0;
}

.project-col.stopped {
  opacity: 0.7;
  filter: grayscale(0.8);
}

/* 停止中のプロジェクト内ではホバー効果を無効化 */
.project-col.stopped:hover {
  box-shadow: var(--shadow-sm);
  transform: none;
}

.project-col.stopped .task-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--border);
  transform: none;
  cursor: default;
}

.project-col.collapsed:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}


/* 折りたたみ時の挙動は grid-template-rows で制御するため display: none は不要 */
.project-col.collapsed .project-header {
  border-bottom: 1px solid transparent;
  transition: border-bottom 0.3s;
}

.project-col.sortable-ghost {
  opacity: .35;
}

.project-header {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
  /* border-radius: var(--radius) var(--radius) 0 0; */
  border-top: 3px solid;
  /* color set inline */
}

.project-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.project-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.proj-drag-handle {
  cursor: grab;
  color: #c8cdd8;
  font-size: 16px;
  flex-shrink: 0;
  user-select: none;
  padding: 2px;
}

.proj-drag-handle:active {
  cursor: grabbing;
}

.project-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}

.status-badge.stopped {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

.task-count-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  background: #f0f2f7;
  color: var(--muted);
  border-radius: 20px;
  padding: 1px 7px;
}

.project-meta-info {
  padding: 0 14px 10px;
  border-bottom: 1px solid var(--border);
}

.project-start-date {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
  display: block;
}

.project-description {
  font-size: 12px;
  color: #4b5563;
  line-height: 1.4;
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-col:not(.collapsed) .project-description:hover {
  -webkit-line-clamp: unset;
  line-clamp: unset;
}

.project-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}

.icon-btn:hover {
  background: #f0f2f7;
  color: var(--text);
}

.icon-btn.active {
  color: var(--accent);
  background: #f0f7ff;
}

.icon-btn.toggle-proj-btn {
  margin-right: 4px;
  font-size: 11px;
}

/* ソートコントロール */
.sort-controls {
  display: flex;
  gap: 4px;
}

.sort-btn {
  font-size: 11px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  cursor: pointer;
  color: var(--muted);
  font-weight: 500;
  transition: all .15s;
}

.sort-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sort-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* =============================================
   タスクリスト
   ============================================= */
.task-list {
  padding: 8px 10px;
  overflow-y: auto;
  flex: 1;
  min-height: 56px;
}

.task-empty {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 18px 0;
}

/* タスクカード */
.task-card {
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 10px 10px 6px;
  margin-bottom: 7px;
  cursor: pointer;
  display: flex;
  gap: 6px;
  align-items: flex-start;
  transition: box-shadow .15s, transform .15s, border-color .15s;
  position: relative;
}

.task-card:hover {
  box-shadow: var(--shadow);
  border-color: #cdd0da;
  transform: translateY(-1px);
}

.task-card.is-done {
  filter: grayscale(1);
  opacity: 0.6;
}

.task-card.is-done:hover {
  filter: grayscale(0.5);
  opacity: 0.8;
}

.task-card:last-child {
  margin-bottom: 0;
}

.task-card.sortable-ghost {
  opacity: .35;
}

.task-card.sortable-drag {
  box-shadow: var(--shadow-lg);
  transform: rotate(1.5deg);
}

.task-drag-handle {
  color: #cdd0da;
  font-size: 15px;
  cursor: grab;
  flex-shrink: 0;
  padding: 1px 0;
  margin-top: 1px;
  user-select: none;
}

.task-drag-handle:active {
  cursor: grabbing;
}

.task-card-body {
  flex: 1;
  min-width: 0;
}

.task-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 6px;
  word-break: break-word;
}

.task-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

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

/* 進捗バー (積み上げ棒グラフ) */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.stacked-progress-bar {
  flex: 1;
  height: 8px;
  background: #e5e8ef;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
}

.progress-segment {
  height: 100%;
}

.progress-pct {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  min-width: 30px;
  text-align: right;
}

/* 日次ログ (タスク詳細) */
.daily-logs-section {
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.daily-logs-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.daily-log-list {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
}

.daily-log-item {
  display: grid;
  grid-template-columns: 100px 120px 1fr;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

.daily-log-item:hover {
  background: #f1f5f9;
}

.daily-log-item:last-child {
  border-bottom: none;
}

.daily-log-date {
  font-weight: 500;
  color: var(--muted);
}

.daily-log-hours {
  font-weight: 600;
  color: var(--accent);
}

.daily-log-pct {
  font-weight: 600;
  text-align: right;
}

.daily-log-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.log-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: flex-end;
}

.log-form-grid .form-group {
  margin-bottom: 0;
}


/* タスク追加ボタン */
.add-task-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  transition: background .15s, color .15s;
}

.add-task-btn:hover {
  background: #f5f7fa;
  color: var(--text);
}

/* =============================================
   ボタン
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #3579c1;
}

.btn-secondary {
  background: #f0f2f7;
  color: #374151;
  border-color: var(--border);
}

.btn-secondary:hover {
  background: #e5e8ef;
}

.btn-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.btn-danger:hover {
  background: #fecaca;
}

/* =============================================
   モーダル
   ============================================= */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 40, .45);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(2px);
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 440px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn .18s ease;
}

.modal-wide {
  width: 520px;
}

.modal-sm {
  width: 360px;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(.97);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

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

.modal-header h2 {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 16px;
  transition: background .15s, color .15s;
}

.modal-close:hover {
  background: #f0f2f7;
  color: var(--text);
}

.modal-body {
  padding: 18px 24px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px 20px;
  border-top: 1px solid var(--border);
}

/* =============================================
   フォーム
   ============================================= */
.form-group {
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.required {
  color: #ef4444;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74, 144, 217, .15);
}

.form-group textarea {
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* カラーピッカー */
.color-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-opt {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform .15s, border-color .15s;
  outline: 2px solid transparent;
}

.color-opt:hover {
  transform: scale(1.15);
}

.color-opt.selected {
  border-color: var(--surface);
  outline-color: var(--text);
  transform: scale(1.15);
}

/* ステータスセレクター */
.status-selector {
  display: flex;
  gap: 12px;
}

.status-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all .15s;
}

.status-opt:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.status-opt:has(input:checked) {
  background: #f0f7ff;
  border-color: var(--accent);
  color: var(--accent);
}

/* Chrome/Safari/Edge doesn't support :has fully yet in all versions, 
   so we use a more standard approach with Adjacent Sibling Combinator if needed,
   but for now let's use a simpler class-based or sibling approach. */
.status-opt input {
  margin: 0;
}

.status-opt input:checked+span {
  color: var(--accent);
  font-weight: 700;
}


/* レンジスライダー */
input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

/* =============================================
   タスクカード: 時間情報
   ============================================= */
.dp-viz-area {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dp-bar-area {
  height: 24px;
  background: #f1f5f9;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dp-bar-seg {
  height: 100%;
  position: relative;
  transition: opacity 0.2s;
}

.dp-bar-seg:hover {
  opacity: 0.9;
}

.dp-bar-rem {
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #94a3b8;
}

.dp-callouts-area {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.dp-callout-fixed {
  flex: 1;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid;
  padding: 10px 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dp-callout-fixed-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.dp-callout-project-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.dp-callout-task-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.dp-callout-hours-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}

.dp-callout-hours-grid b {
  color: var(--text);
}

.dp-callout-prog-bar-wrap {
  margin-top: 4px;
}

.dp-callout-prog-text {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
}

.dp-callout-prog-arrow {
  color: var(--accent);
}

.dp-callout-prog-bar {
  height: 6px;
  background: #f1f5f9;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.dp-callout-prog-fill-cur {
  height: 100%;
  background: #cbd5e1;
  position: absolute;
  left: 0;
  top: 0;
}

.dp-callout-prog-fill-new {
  height: 100%;
  background: var(--accent);
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0.6;
}

.dp-callout-no-est-msg {
  font-size: 11px;
  color: #94a3b8;
  font-style: italic;
}

.dp-task-sub-menu {
  position: absolute;
  top: 4px;
  right: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.task-card:hover .dp-task-sub-menu {
  opacity: 1;
}

.btn-mini {
  padding: 2px 6px;
  font-size: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.btn-mini:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.task-est-h,
.task-act-h {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  white-space: nowrap;
}

.task-est-h {
  background: #eff6ff;
  color: #3b82f6;
}

.task-act-h {
  background: #f0fdf4;
  color: #16a34a;
}

/* =============================================
   タスクモーダル: 時間入力
   ============================================= */
.input-with-unit {
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-with-unit input {
  flex: 1;
}

.input-unit {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

/* =============================================
   今日の作業計画
   ============================================= */
.daily-plan {
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.daily-plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.dp-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dp-icon {
  font-size: 16px;
}

.dp-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.dp-date {
  font-size: 12px;
  color: var(--muted);
}

.dp-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dp-ctrl-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

.dp-hours-input {
  width: 64px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  background: var(--surface);
  font-family: inherit;
}

.dp-hours-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74, 144, 217, .15);
}

.dp-ctrl-unit {
  font-size: 13px;
  color: var(--muted);
}

.dp-toggle-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 28px;
  height: 28px;
  cursor: pointer;
  color: var(--muted);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}

.dp-toggle-btn:hover {
  background: #f0f2f7;
  color: var(--text);
}

.dp-body {
  padding: 0 24px 14px;
  transition: max-height .3s ease, opacity .3s;
  overflow: hidden;
  max-height: 400px;
  opacity: 1;
}

.dp-body.dp-collapsed {
  max-height: 0;
  padding-bottom: 0;
  opacity: 0;
  pointer-events: none;
}

/* ドロップゾーン */
.dp-drop-zone {
  min-height: 44px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  padding: 6px;
  transition: border-color .2s, background .2s;
}

.dp-drop-zone.dp-drag-over {
  border-color: var(--accent);
  background: rgba(74, 144, 217, .07);
}

.task-card-dragging {
  opacity: .5;
}

.dp-tasks-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 32px;
}

.dp-drop-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  padding: 6px 0;
  gap: 6px;
  pointer-events: none;
}

/* タスクアイテム (計画リスト内) */
.dp-task-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8f9fc;
  border: 1px solid var(--border);
  border-left: 3px solid var(--proj-color, var(--accent));
  padding: 5px 10px 5px 8px;
  font-size: 12px;
  cursor: grab;
  transition: box-shadow .15s;
}

.dp-task-item:active {
  cursor: grabbing;
}

.dp-task-item:hover {
  box-shadow: var(--shadow-sm);
}

.dp-task-item.sortable-ghost {
  opacity: .35;
}

.dp-task-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 140px;
}

.dp-task-proj {
  font-size: 10px;
  color: var(--proj-color, var(--muted));
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.dp-task-name {
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.dp-task-hours-inp {
  width: 48px;
  padding: 2px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  text-align: center;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}

.dp-task-hours-inp:focus {
  outline: none;
  border-color: var(--accent);
}

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

.dp-task-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: #c8cdd8;
  font-size: 11px;
  padding: 0 2px;
  line-height: 1;
  transition: color .15s;
}

.dp-task-remove:hover {
  color: #ef4444;
}

/* =============================================
   今日の作業計画 バー
   ============================================= */
.dp-bar-wrap {
  width: 100%;
}

.dp-bar {
  display: flex;
  width: 100%;
  height: 36px;
  border-radius: var(--radius-sm);
  overflow: visible;
  position: relative;
}

.dp-bar-seg {
  position: relative;
  height: 100%;
  min-width: 4px;
  transition: filter .15s;
  cursor: pointer;
}

.dp-bar-seg:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.dp-bar-seg:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.dp-bar-seg:only-child {
  border-radius: var(--radius-sm);
}

.dp-bar-seg:hover {
  filter: brightness(1.12);
  z-index: 10;
}

.dp-bar-rem {
  background: #e5e8ef !important;
  cursor: default;
}

.dp-bar-rem:hover {
  filter: none;
}

/* 吹き出し */
.dp-callout {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 100;
  box-shadow: var(--shadow);
  pointer-events: none;
}

.dp-callout::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text);
}

.dp-bar-seg:hover .dp-callout {
  display: block;
}

.dp-callout-name {
  font-weight: 600;
  margin-bottom: 4px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dp-callout-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.dp-callout-cur {
  color: #94a3b8;
}

.dp-callout-arrow {
  color: #94a3b8;
  font-size: 11px;
}

.dp-callout-new {
  color: #4ade80;
  font-weight: 700;
}

.dp-callout-no-est {
  color: #94a3b8;
  font-size: 11px;
  margin-bottom: 3px;
}

.dp-callout-hours {
  color: #94a3b8;
  font-size: 11px;
}

.dp-callout-rem .dp-callout-name {
  color: #94a3b8;
  font-weight: 400;
}

.dp-bar-footer {
  margin-top: 5px;
  font-size: 11px;
  text-align: right;
}

.dp-time-summary {
  color: var(--muted);
}

.dp-over-warn {
  color: #f59e0b;
  font-weight: 600;
}

/* =============================================
   タスク完了ボタン & グレーアウト
   ============================================= */
.task-done-btn {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: transparent;
  transition: border-color .15s, background .15s, color .15s;
  margin-top: 2px;
  padding: 0;
  line-height: 1;
}

.task-done-btn:hover {
  border-color: #10b981;
  color: #10b981;
}

.task-done-btn.done {
  border-color: #10b981;
  background: #10b981;
  color: #fff;
}

.task-card.is-done {
  opacity: 0.5;
  background: #f4f5f8;
}

.task-card.is-done .task-name {
  text-decoration: line-through;
  color: var(--muted);
}

.task-card.is-done:hover {
  box-shadow: none;
  transform: none;
  border-color: var(--border);
}

/* =============================================
   スクロールバー (Webkit)
   ============================================= */
.task-list::-webkit-scrollbar,
.board::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.task-list::-webkit-scrollbar-track,
.board::-webkit-scrollbar-track {
  background: transparent;
}

.task-list::-webkit-scrollbar-thumb,
.board::-webkit-scrollbar-thumb {
  background: #d0d4de;
  border-radius: 3px;
}

/* =============================================
   レスポンシブ (メディアクエリ)
   ============================================= */
@media screen and (max-width: 600px) {
  .app-header {
    padding: 0 16px;
  }

  .app-title {
    font-size: 15px;
  }

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

  .daily-plan-header {
    padding: 10px 16px;
  }

  .dp-body {
    padding: 0 16px 14px;
  }

  .board {
    columns: 1;
    padding: 12px;
  }

  .project-col {
    max-height: 500px;
  }
}

@media screen and (min-width: 601px) and (max-width: 1024px) {
  .board {
    columns: 2;
    padding: 16px;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}