/* ===== Todo View — Things 3 + Linear inspired ===== */
.view-todo {
  flex-direction: column;
  height: 100%;
}

.todo-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* ===== Header ===== */
.todo-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.todo-view-title {
  font-size: 20px;
  font-weight: 700;
}

.todo-header-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  margin-left: 8px;
}

/* cursor/transition from .ui-btn base */
.todo-add-btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.todo-add-btn:hover {
  opacity: 0.9;
  box-shadow: var(--shadow-md);
}

/* Tabs: the todo view uses the shared .ui-tabs / .ui-tab segmented control
   (css/ui-primitives.css), the same primitive the work surfaces use. */

/* ===== Filters ===== */
.todo-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* cursor/transition from .ui-btn base */
.todo-filter-btn {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface-control-selected);
  color: var(--text-secondary);
  font-size: 12px;
}

.todo-filter-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ===== Empty State ===== */
/* Empty state: todo uses the shared .ui-empty primitive (css/ui-primitives.css),
   the same one the work surfaces use for their whole-view-empty screens. */

/* ===== Quest Board ===== */
.quest-board {
  background: var(--surface-panel-muted);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 20px;
  transition: background 500ms ease, border-color 500ms ease;
}

.quest-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.quest-stat {
  font-size: 13px;
  color: var(--text-secondary);
}

.quest-stat-num {
  font-weight: 700;
  color: var(--text-primary);
}

.quest-stat-done {
  font-weight: 700;
  color: var(--accent);
}

.quest-stat-remaining {
  font-size: 12px;
  color: var(--text-muted);
}

.quest-progress-track {
  height: 14px;
  background: var(--surface-control-track-hover);
  border-radius: 7px;
  overflow: hidden;
  margin-bottom: 10px;
  position: relative;
}

.quest-progress-fill {
  height: 100%;
  border-radius: 7px;
  background: var(--accent);
  transition: width 400ms ease;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

/* 70%+ 목표 구배 — 골드 전환 + shimmer + 가속 트랜지션 */
.quest-progress-fill.gold {
  background: linear-gradient(90deg, #F59E0B, #FBBF24);
  background-size: 200% 100%;
  animation: questPulse 2s ease-in-out infinite, questShimmer 2.5s linear infinite;
  transition: width 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* 90%+ 추가 강조 — 밝은 그라데이션 + 빠른 펄스 + 강한 shimmer */
.quest-progress-fill.gold-hot {
  background: linear-gradient(90deg, #F59E0B, #FBBF24, #FDE68A, #FBBF24);
  background-size: 300% 100%;
  animation: questPulseHot 1.2s ease-in-out infinite, questShimmerHot 1.5s linear infinite;
  transition: width 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes questPulseHot {
  0%, 100% { box-shadow: 0 0 0 rgba(245, 158, 11, 0); }
  50% { box-shadow: 0 0 12px rgba(251, 191, 36, 0.5), 0 0 4px rgba(245, 158, 11, 0.3); }
}

/* 목표 구배 shimmer — 빛이 바를 따라 이동 */
@keyframes questShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes questShimmerHot {
  0% { background-position: 300% 0; }
  100% { background-position: -300% 0; }
}

.quest-progress-label {
  font-size: 10px;
  font-weight: 700;
  color: white;
  padding-right: 6px;
  white-space: nowrap;
  text-shadow: 0 0 2px rgba(0,0,0,0.3);
  line-height: 14px;
}

@keyframes questPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 rgba(245, 158, 11, 0); }
  50% { opacity: 0.85; box-shadow: 0 0 6px rgba(245, 158, 11, 0.4); }
}

.quest-nudge {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* 올클리어 퀘스트 보드 — 배경색 전환 */
.quest-board.all-clear {
  background: linear-gradient(135deg, rgba(34,197,94,0.08), rgba(251,191,36,0.08));
  border: 1px solid rgba(34,197,94,0.2);
}

/* 올클리어 배너 — 축하 강조 */
.quest-all-clear-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-top: 10px;
  background: linear-gradient(135deg, rgba(34,197,94,0.12), rgba(251,191,36,0.1));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(34,197,94,0.15);
  animation: allClearReveal 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

/* 배너 내부 미묘한 shimmer */
.quest-all-clear-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255,255,255,0.15) 50%,
    transparent 60%
  );
  background-size: 250% 100%;
  animation: allClearShimmer 3s ease-in-out 800ms infinite;
  pointer-events: none;
}

.quest-all-clear-icon {
  font-size: 22px;
  flex-shrink: 0;
  animation: allClearBounce 600ms ease 300ms both;
  filter: drop-shadow(0 0 4px rgba(34,197,94,0.4));
}

.quest-all-clear-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
}

.quest-all-clear-sub {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 2px;
}

@keyframes allClearReveal {
  0% { opacity: 0; transform: scale(0.92) translateY(6px); }
  60% { transform: scale(1.02) translateY(-1px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes allClearBounce {
  0% { transform: scale(0) rotate(-15deg); }
  50% { transform: scale(1.25) rotate(5deg); }
  75% { transform: scale(0.95) rotate(-2deg); }
  100% { transform: scale(1) rotate(0deg); }
}

@keyframes allClearShimmer {
  0%, 100% { background-position: 250% 0; }
  50% { background-position: -250% 0; }
}

/* 프로그레스 100% 완료 — 초록 전환 + 정적 안정감 */
.quest-progress-fill.complete {
  background: linear-gradient(90deg, #22C55E, #4ADE80);
  animation: questCompletePulse 1.5s ease 200ms 1;
  box-shadow: 0 0 8px rgba(34,197,94,0.3);
}

@keyframes questCompletePulse {
  0% { box-shadow: 0 0 0 rgba(34,197,94,0); }
  40% { box-shadow: 0 0 12px rgba(34,197,94,0.5); }
  100% { box-shadow: 0 0 8px rgba(34,197,94,0.3); }
}

/* ===== Streak Badge ===== */
.quest-streak-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 6px 12px;
  background: linear-gradient(135deg, rgba(251,191,36,0.1), rgba(245,158,11,0.06));
  border-radius: var(--radius-lg);
  animation: streakReveal 400ms ease;
}

.quest-streak-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.quest-streak-text {
  font-size: 13px;
  font-weight: 600;
  color: #D97706;
}

/* 스트릭 끊김 → 복귀 환영 메시지 */
.quest-streak-comeback {
  margin-bottom: 10px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  background: linear-gradient(135deg, rgba(34,197,94,0.06), rgba(99,102,241,0.06));
  border-radius: var(--radius-lg);
  animation: streakReveal 400ms ease;
}

@keyframes streakReveal {
  0% { opacity: 0; transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ===== Due-Date Glow (기한 임박) ===== */
/* D-3: 미세한 따뜻한 배경 */
.todo-item.due-glow-d3 {
  background: rgba(251, 191, 36, 0.04);
}
.todo-item.due-glow-d3 .todo-due {
  color: #D97706;
  background: rgba(251, 191, 36, 0.12);
  font-weight: 600;
}

/* D-2: 약간 더 강한 배경 */
.todo-item.due-glow-d2 {
  background: rgba(251, 191, 36, 0.07);
}
.todo-item.due-glow-d2 .todo-due {
  color: #B45309;
  background: rgba(245, 158, 11, 0.15);
  font-weight: 600;
}

/* D-1: 주황 톤 배경 */
.todo-item.due-glow-d1 {
  background: rgba(245, 158, 11, 0.08);
}
.todo-item.due-glow-d1 .todo-due {
  color: #92400E;
  background: rgba(245, 158, 11, 0.18);
  font-weight: 700;
}

/* D-Day: 부드러운 펄스 애니메이션 */
.todo-item.due-glow-today {
  animation: dueDayPulse 2.5s ease-in-out infinite;
}

@keyframes dueDayPulse {
  0%, 100% { background: rgba(245, 158, 11, 0.06); }
  50% { background: rgba(245, 158, 11, 0.13); }
}

/* ===== Section ===== */
.todo-section {
  margin-bottom: 20px;
}

.todo-section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  cursor: pointer;
  user-select: none;
  border-radius: var(--radius-md);
}

.todo-section-header:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.todo-section-arrow {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 200ms;
  display: inline-block;
  width: 16px;
}

.todo-section-arrow.open {
  transform: rotate(90deg);
}

.todo-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.todo-section-count {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface-control-track-hover);
  padding: 1px 8px;
  border-radius: var(--radius-full);
}

.todo-section-body {
  padding-left: 4px;
}

/* ===== Project Group ===== */
.todo-project-group {
  margin-bottom: 12px;
}

.todo-project-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 6px 0 4px 22px;
}

.todo-project-count {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

/* ===== Todo Item ===== */
.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  transition: background 150ms;
  cursor: default;
}

.todo-item:hover {
  background: var(--surface-control-track);
}

.todo-item.done {
  opacity: 0.55;
}

/* Checkbox */
.todo-checkbox-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
  cursor: pointer;
}

.todo-checkbox {
  opacity: 0;
  position: absolute;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 1;
}

.todo-checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 50%;
  transition: all 200ms;
  position: relative;
}

.todo-item.priority-high .todo-checkmark {
  border-color: #EF4444;
}

.todo-item.priority-low .todo-checkmark {
  border-color: var(--text-muted);
}

.todo-item.in-progress .todo-checkmark {
  border-color: var(--accent);
  background: var(--accent-light);
}

.todo-checkbox:checked + .todo-checkmark {
  background: var(--status-online);
  border-color: var(--status-online);
  animation: todoCheckPop 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.todo-checkbox:checked + .todo-checkmark::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  animation: todoCheckDraw 200ms ease-out 80ms both;
}

/* 완료 팡! 이펙트 — 체크 시 scale bounce + ring ripple */
@keyframes todoCheckPop {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  30% { transform: scale(1.25); box-shadow: 0 0 0 5px rgba(34,197,94,0.2); }
  50% { transform: scale(0.92); }
  70% { transform: scale(1.05); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

@keyframes todoCheckDraw {
  0% { opacity: 0; transform: rotate(45deg) scale(0.3); }
  60% { opacity: 1; transform: rotate(45deg) scale(1.1); }
  100% { opacity: 1; transform: rotate(45deg) scale(1); }
}

/* 완료 직후 아이템 하이라이트 — 좌→우 sweep */
.todo-item.just-completed {
  animation: todoItemGlow 600ms ease-out;
}

.todo-item.just-completed .todo-item-title {
  animation: todoStrikeReveal 350ms ease-out 150ms both;
}

@keyframes todoItemGlow {
  0% { background: rgba(34,197,94,0.15); }
  40% { background: rgba(34,197,94,0.08); }
  100% { background: transparent; }
}

/* 취소선이 왼쪽에서 오른쪽으로 그어지는 효과 */
@keyframes todoStrikeReveal {
  0% { text-decoration-color: transparent; }
  100% { text-decoration-color: var(--text-muted); }
}

/* 완료 파티클 버스트 — 체크 시 작은 원이 퍼져 나감 */
.completion-particle {
  position: fixed;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--status-online, #22C55E);
  pointer-events: none;
  z-index: 9999;
  animation: particleBurst 450ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.completion-particle.var-gold { background: #FBBF24; width: 4px; height: 4px; }
.completion-particle.var-accent { background: var(--accent, #4F6AFF); width: 6px; height: 6px; }
.completion-particle.var-spark { border-radius: 1px; width: 3px; height: 7px; }

@keyframes particleBurst {
  0% { transform: translate(0, 0) scale(1); opacity: 0.9; }
  50% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}

/* Item body */
.todo-item-body {
  flex: 1;
  min-width: 0;
  cursor: pointer;
  border-radius: var(--radius-md);
}

.todo-item-body:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.todo-item-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.todo-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}

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

.todo-priority-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.todo-priority-dot.priority-high { background: var(--status-error); }
.todo-priority-dot.priority-medium { background: var(--status-warning); }
.todo-priority-dot.priority-low { background: var(--text-muted); }

/* Meta row */
.todo-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 3px;
}

.todo-due {
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--surface-control-track-hover);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
}

.todo-due.today {
  color: var(--accent);
  background: var(--accent-light);
  font-weight: 600;
}

.todo-due.overdue {
  color: #EF4444;
  background: #FEF2F2;
  font-weight: 600;
}

.todo-project-label {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface-control-track-hover);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
}

.todo-tag {
  font-size: 10px;
  color: var(--accent);
  background: var(--accent-light);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
}

/* ===== Popup Modal ===== */
.todo-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: todoFadeIn 200ms ease;
}

.todo-popup {
  width: 100%;
  max-width: 500px;
  background: var(--surface-panel);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 20px;
  box-shadow: 0 -4px 30px rgba(0,0,0,0.15);
  animation: todoSlideUp 250ms ease;
  max-height: 85vh;
  overflow-y: auto;
}

@keyframes todoSlideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes todoFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.todo-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.todo-popup-title {
  font-size: 16px;
  font-weight: 600;
}

.todo-popup-close {
  background: var(--surface-control-track);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.todo-popup-close:hover {
  background: var(--surface-control-track-hover);
  color: var(--text-primary);
}

/* Form fields */
.todo-form-field {
  margin-bottom: 14px;
}

.todo-form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.todo-form-input,
.todo-form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-control-track);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-family);
  box-sizing: border-box;
  transition: border-color 150ms;
}

.todo-form-input:focus,
.todo-form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.todo-form-textarea {
  resize: vertical;
  min-height: 60px;
}

/* Priority buttons */
.todo-priority-group {
  display: flex;
  gap: 6px;
}

/* cursor/transition from .ui-btn base */
.todo-priority-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface-control-selected);
  color: var(--text-secondary);
  font-size: 13px;
}

.todo-priority-btn[data-priority="high"].active {
  background: #FEF2F2;
  color: #EF4444;
  border-color: #EF4444;
}

.todo-priority-btn[data-priority="medium"].active {
  background: #FFFBEB;
  color: #F59E0B;
  border-color: #F59E0B;
}

.todo-priority-btn[data-priority="low"].active {
  background: var(--surface-control-track-hover);
  color: var(--text-secondary);
  border-color: var(--text-muted);
}

/* Expand/More links */
.todo-form-expand,
.todo-form-more {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  font-family: var(--font-family);
  cursor: pointer;
  padding: 4px 0;
}

.todo-form-expand:hover,
.todo-form-more:hover {
  text-decoration: underline;
}

/* Suggestion chips */
.todo-suggest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.todo-suggest-chips:empty {
  display: none;
}

.todo-suggest-chip {
  font-size: 11px;
  font-family: var(--font-family);
  color: var(--text-secondary, #6B7280);
  background: var(--bg-secondary, #F3F4F6);
  border: 1px solid var(--border-light, #E5E7EB);
  border-radius: var(--radius-full);
  padding: 2px 10px;
  cursor: pointer;
  transition: all 150ms;
}

.todo-suggest-chip:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light, #EEF0FF);
}

/* Form actions */
.todo-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  gap: 8px;
}

.todo-form-delete {
  background: none;
  border: 1px solid #EF4444;
  color: #EF4444;
  border-radius: var(--radius-full);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all 150ms;
}

.todo-form-delete:hover {
  background: #FEF2F2;
}

.todo-form-submit {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(79, 106, 255, 0.3);
  transition: all 150ms;
  margin-left: auto;
}

.todo-form-submit:hover {
  opacity: 0.9;
  box-shadow: 0 4px 12px rgba(79, 106, 255, 0.4);
}

/* ===== Desktop: popup centered ===== */
@media (min-width: 768px) {
  .todo-popup-overlay {
    align-items: center;
  }

  .todo-popup {
    border-radius: var(--radius-xl);
    max-height: 70vh;
  }
}

/* ===== Mobile ===== */
@media (max-width: 767px) {
  .todo-scroll {
    padding: 16px;
  }

  .todo-item {
    padding: 8px 10px;
  }

  .todo-filters {
    gap: 4px;
  }

  .todo-filter-btn {
    padding: 4px 10px;
    font-size: 11px;
  }

  .todo-popup {
    padding: 16px;
  }


  .todo-classify-btn {
    padding: 6px 6px;
    font-size: 11px;
  }

  .todo-inbox-item {
    padding: 12px 14px;
  }

  .todo-project-card {
    padding: 14px;
  }
}

/* ===== Inbox View ===== */
.todo-inbox-header {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding: 0 4px;
}

.todo-inbox-count {
  font-weight: 600;
}

.todo-inbox-item {
  background: var(--surface-panel-muted);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: background 150ms;
}

.todo-inbox-item:hover {
  background: var(--surface-control-track-hover);
}

.todo-inbox-item-body {
  cursor: pointer;
  margin-bottom: 10px;
}

.todo-inbox-item-body:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}

.todo-inbox-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.todo-inbox-item-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.3;
}

.todo-inbox-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

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

.todo-inbox-actions {
  display: flex;
  gap: 6px;
}

.todo-classify-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-control-selected);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all 150ms;
}

.todo-classify-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.todo-classify-todo:hover {
  border-color: #22C55E;
  color: #22C55E;
  background: rgba(34, 197, 94, 0.08);
}

.todo-classify-someday:hover {
  border-color: #8B5CF6;
  color: #8B5CF6;
  background: rgba(139, 92, 246, 0.08);
}

.todo-classify-delegated:hover {
  border-color: #F59E0B;
  color: #F59E0B;
  background: rgba(245, 158, 11, 0.08);
}

.todo-classify-icon {
  font-size: 13px;
}

/* ===== Today / Next Action View ===== */
.todo-today-section {
  margin-bottom: 20px;
}

.todo-today-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.todo-today-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.todo-today-dot.in-progress {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

.todo-today-dot.high {
  background: #EF4444;
  box-shadow: 0 0 6px #EF4444;
}

.todo-context-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* ===== Status Transition Buttons ===== */
.todo-status-actions {
  display: flex;
  gap: 2px;
  align-items: center;
  flex-shrink: 0;
  margin-left: 4px;
}

/* cursor/display-flex/transition/font-family from .ui-btn base */
.todo-status-btn {
  font-size: 12px;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light, #E5E7EB);
  background: none;
  color: var(--text-tertiary, #9CA3AF);
  padding: 0;
}

.todo-status-btn:hover {
  background: var(--bg-secondary, #F3F4F6);
}

.todo-status-btn.btn-start:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.todo-status-btn.btn-pause:hover,
.todo-status-btn.btn-delegate:hover {
  color: #F59E0B;
  border-color: #F59E0B;
}

.todo-status-btn.btn-activate:hover {
  color: #10B981;
  border-color: #10B981;
}

.todo-status-btn.btn-someday:hover {
  color: #8B5CF6;
  border-color: #8B5CF6;
}

/* ===== WIP Nudge ===== */
.todo-wip-nudge {
  font-size: 11px;
  color: #F59E0B;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  margin-bottom: 8px;
  text-align: center;
}

/* ===== Project Dashboard ===== */
.todo-project-card {
  background: var(--surface-panel-muted);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 10px;
  transition: background 150ms;
}

.todo-project-card:hover {
  background: var(--surface-control-track-hover);
}

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

.todo-project-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.todo-project-warning {
  font-size: 11px;
  font-weight: 600;
  color: #F59E0B;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  animation: warningPulse 2s ease-in-out infinite;
}

@keyframes warningPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.todo-project-card-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.todo-project-card-pct {
  font-weight: 700;
  color: var(--text-primary);
}

.todo-project-progress-track {
  height: 6px;
  background: var(--surface-control-track-hover);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}

.todo-project-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width 400ms ease;
}

.todo-project-next {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 8px 10px;
  background: var(--surface-panel);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
}

.todo-project-next-label {
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

.todo-project-next-title {
  color: var(--text-primary);
  font-weight: 500;
}

.todo-project-next-title.priority-high {
  color: #EF4444;
}

.todo-project-upcoming {
  margin-top: 6px;
}

.todo-project-upcoming-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 4px 10px;
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  .quest-progress-fill,
  .quest-progress-fill.gold,
  .quest-progress-fill.gold-hot,
  .quest-progress-fill.complete {
    animation: none;
    transition: width 0ms;
  }

  .todo-item.due-glow-today {
    animation: none;
    background: rgba(245, 158, 11, 0.1);
  }

  .todo-checkbox:checked + .todo-checkmark {
    animation: none;
  }

  .todo-item.just-completed {
    animation: none;
  }

  .todo-item.just-completed .todo-item-title {
    animation: none;
  }

  .quest-all-clear-banner {
    animation: none;
  }

  .quest-all-clear-banner::after {
    animation: none;
  }

  .quest-all-clear-icon {
    animation: none;
  }

  .quest-streak-badge,
  .quest-streak-comeback {
    animation: none;
  }

  .todo-project-warning {
    animation: none;
  }
}

/* ===== History View ===== */

.todo-history-summary {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle, #e0e0e0);
}

.todo-history-stat {
  flex: 1;
  text-align: center;
  padding: 8px;
  background: var(--bg-secondary, #f5f5f5);
  border-radius: 8px;
}

.todo-history-stat-num {
  display: block;
  font-size: 1.4em;
  font-weight: 700;
  color: var(--accent, #4a90d9);
}

.todo-history-stat-label {
  font-size: 0.75em;
  color: var(--text-muted, #888);
}

.todo-history-group {
  margin-bottom: 12px;
}

.todo-history-date {
  font-size: 0.8em;
  font-weight: 600;
  color: var(--text-muted, #888);
  padding: 8px 0 4px;
  border-bottom: 1px solid var(--border-subtle, #e0e0e0);
  margin-bottom: 4px;
}

.todo-history-date-count {
  font-weight: 400;
  color: var(--text-muted, #aaa);
}

.todo-history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  font-size: 0.85em;
}

.todo-history-check {
  color: var(--accent, #4a90d9);
  font-weight: 700;
  flex-shrink: 0;
}

.todo-history-title {
  flex: 1;
  color: var(--text-secondary, #666);
}

.todo-history-project {
  font-size: 0.75em;
  background: var(--bg-secondary, #f0f0f0);
  color: var(--text-muted, #888);
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
