/* Daily Moment - 최종 CSS 파일 */

/* 통계 모듈 스타일은 분리된 CSS로 지연 로드됩니다 (statistics.css) */

/* ==========================================================================
   1. Reset & Base Styles (초기화 및 기본 스타일)
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* CSS Reset - Add transition for theme */
body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

html {
  width: 100%;
  height: 100%;
}

body {
  width: 100%;
  height: 100%; /* Restore strict 100% height to be managed by overflow */
  margin: 0;
  overflow-x: hidden;
  /* overflow-y is auto by default */
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
  background-color: var(--dm-background);
  color: var(--dm-text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Landing Mode Body Style */
body.landing-mode {
  /* Deep Dark Gradient Background applied to body to cover full viewport */
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
  background-attachment: fixed;
  background-size: cover;
  color: #fff;
  margin: 0;
  /* FORCE hide scrollbar on body for landing page to look clean */
  overflow: hidden; 
}

/* Hide Footer in Landing Mode to prevent white space/overflow */
body.landing-mode .app-footer {
  display: none !important;
}

:root {
  /* Daily Moment UI Improvement Color Palette */
  --dm-primary: #6366F1;
  --dm-secondary: #F59E0B;
  --dm-background: #FAFAFA;
  --dm-surface: #FFFFFF;
  --dm-text-primary: #1F2937;
  --dm-text-secondary: #6B7280;
  --dm-success: #10B981;
  --dm-error: #EF4444;
  
  /* Legacy colors for compatibility */
  --primary-50: #f0f9ff;
  --primary-100: #e0f2fe;
  --primary-200: #bae6fd;
  --primary-300: #7dd3fc;
  --primary-500: #6366F1;
  --primary-600: #6366F1;
  --primary-700: #5b21b6;
  --primary-900: #0c4a6e;
  --success-50: #f0fdf4;
  --success-100: #dcfce7;
  --success-200: #bbf7d0;
  --success-500: #22c55e;
  --success-600: #16a34a;
  --success-700: #15803d;
  --warning-50: #fffbeb;
  --warning-100: #fef3c7;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --error-50: #fef2f2;
  --error-100: #fee2e2;
  --error-500: #ef4444;
  --error-600: #dc2626;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Color Theme Palette - 10 harmonious colors */
  /* Neutral & Soft Tones */
  --color-slate-bg: #f8fafc;
  --color-slate-border: #e2e8f0;
  --color-slate-accent: #64748b;
  --color-slate-text: #334155;
  
  --color-stone-bg: #fafaf9;
  --color-stone-border: #e7e5e4;
  --color-stone-accent: #78716c;
  --color-stone-text: #44403c;
  
  /* Pastel Tones */
  --color-lavender-bg: #f3f0ff;
  --color-lavender-border: #e9e3ff;
  --color-lavender-accent: #9b72ff;
  --color-lavender-text: #5b21b6;
  
  --color-mint-bg: #ecfdf5;
  --color-mint-border: #d1fae5;
  --color-mint-accent: #34d399;
  --color-mint-text: #059669;
  
  --color-peach-bg: #fff7ed;
  --color-peach-border: #fed7aa;
  --color-peach-accent: #fb923c;
  --color-peach-text: #c2410c;
  
  --color-sky-bg: #f0f9ff;
  --color-sky-border: #bae6fd;
  --color-sky-accent: #38bdf8;
  --color-sky-text: #0369a1;
  
  /* Vivid Accent Tones */
  --color-coral-bg: #fff5f5;
  --color-coral-border: #fecaca;
  --color-coral-accent: #f87171;
  --color-coral-text: #b91c1c;
  
  --color-amber-bg: #fffbeb;
  --color-amber-border: #fde68a;
  --color-amber-accent: #fbbf24;
  --color-amber-text: #b45309;
  
  --color-emerald-bg: #f0fdf4;
  --color-emerald-border: #bbf7d0;
  --color-emerald-accent: #34d399;
  --color-emerald-text: #047857;
  
  --color-indigo-bg: #eef2ff;
  --color-indigo-border: #c7d2fe;
  --color-indigo-accent: #6366f1;
  --color-indigo-text: #4338ca;
  /* Shadows & Radius */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1),
    0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1),
    0 8px 10px -6px rgb(0 0 0 / 0.1);
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  
  /* Loader Variables */
  --dm-overlay-bg: rgba(255, 255, 255, 0.9);
  --dm-spinner-track: rgba(0, 0, 0, 0.1);
}

/* Dark Mode Variables */
@media (prefers-color-scheme: dark) {
  :root {
    --dm-background: #111827; /* Gray 900 */
    --dm-surface: #1f2937; /* Gray 800 */
    --dm-text-primary: #f9fafb; /* Gray 50 */
    --dm-text-secondary: #d1d5db; /* Gray 300 */
    
    /* Invert Grays for Dark Mode consistency */
    --gray-50: #111827;
    --gray-100: #1f2937;
    --gray-200: #374151;
    --gray-300: #4b5563;
    --gray-400: #6b7280;
    --gray-500: #9ca3af;
    --gray-600: #d1d5db;
    --gray-700: #e5e7eb;
    --gray-800: #f3f4f6;
    --gray-900: #f9fafb;
    
    --dm-overlay-bg: rgba(17, 24, 39, 0.95);
    --dm-spinner-track: rgba(255, 255, 255, 0.1);
  }
}

/* Force Dark Mode Class */
[data-theme="dark"] {
    --dm-background: #111827;
    --dm-surface: #1f2937;
    --dm-text-primary: #f9fafb;
    --dm-text-secondary: #d1d5db;
    
    --gray-50: #111827;
    --gray-100: #1f2937;
    --gray-200: #374151;
    --gray-300: #4b5563;
    --gray-400: #6b7280;
    --gray-500: #9ca3af;
    --gray-600: #d1d5db;
    --gray-700: #e5e7eb;
    --gray-800: #f3f4f6;
    --gray-900: #f9fafb;
    
    --dm-overlay-bg: rgba(17, 24, 39, 0.95);
    --dm-spinner-track: rgba(255, 255, 255, 0.1);
}

/* Force Light Mode Class */
[data-theme="light"] {
    --dm-background: #FAFAFA;
    --dm-surface: #FFFFFF;
    --dm-text-primary: #1F2937;
    --dm-text-secondary: #6B7280;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
    "Ubuntu", "Cantarell", sans-serif;
  background-color: var(--dm-background);
  color: var(--dm-text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.hidden {
  display: none !important;
}

html[data-initial-shell="auth"] body {
  cursor: progress;
}

html[data-initial-shell="auth"] #login-view {
  display: none;
}

html[data-initial-shell="guest"] #main-app {
  display: none;
}

/* === Loader Overlay === */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--dm-overlay-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
}

.loader-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-overlay.inline-mode {
  background-color: transparent;
  backdrop-filter: none;
  pointer-events: none;
}

.loader-overlay.inline-mode .loader-content {
  padding: 12px 20px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.75);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.3);
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.loader-brand-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  animation: pulse-logo 2.5s infinite ease-in-out;
}

.loader-logo-icon {
  width: 50px; /* 아이콘 크기 조정 */
  height: auto;
}

.loader-brand-text {
  font-family: 'Pretendard', -apple-system, sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--dm-text-primary);
  letter-spacing: -0.5px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--dm-spinner-track);
  border-left-color: var(--dm-primary, #6366F1);
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
}

#loader-text {
  font-size: 16px;
  font-weight: 500;
  color: var(--dm-text-secondary, #6B7280);
}

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

@keyframes pulse-logo {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.85;
  }
}

/* ==========================================================================
     2. Main App Layout (앱 전체 레이아웃)
     ========================================================================== */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
  background-color: var(--gray-50);
}

/* 랭킹 페이지에서는 전체 화면 너비 활용 */
.rankings-full-width .app-container {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
}

.rankings-full-width .app-main {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  background-color: var(--dm-surface);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1001;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-600);
  text-decoration: none;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-main {
  flex-grow: 1;
  padding: 2rem;
  overflow-y: auto;
  background-color: var(--dm-background);
}

#main-app.app-shell-loading,
.app-container.app-shell-loading {
  position: relative;
  pointer-events: none;
}

#main-app.app-shell-loading::before,
.app-container.app-shell-loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-image: linear-gradient(90deg, rgba(14, 165, 233, 0.2), rgba(14, 165, 233, 0.9), rgba(14, 165, 233, 0.2));
  background-size: 200% 100%;
  animation: appShellLoadingBar 1.2s ease-in-out infinite;
  z-index: 5;
}

#main-app.app-shell-loading .view,
.app-container.app-shell-loading .view {
  opacity: 0.25;
  transition: opacity 0.3s ease;
}

@keyframes appShellLoadingBar {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 200% 0;
  }
}

.view {
  display: none;
}
.view.active {
  display: block;
  animation: fadeIn 0.5s ease;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ==========================================================================
     3. Common Components (공통 컴포넌트)
     ========================================================================== */
/* --- Buttons --- */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-primary {
  background: var(--dm-primary);
  color: white;
  box-shadow: 0 1px 3px rgba(99, 102, 241, 0.2);
}
.btn-primary:hover {
  background: #5b21b6;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}
.btn-secondary {
  background: var(--gray-200);
  color: var(--gray-800);
}
.btn-secondary:hover {
  background: var(--gray-300);
}
.btn-icon {
  width: 36px;  /* 32px에서 36px로 통일 */
  height: 36px;  /* 32px에서 36px로 통일 */
  min-width: 36px;  /* 최소 크기 보장 */
  min-height: 36px;  /* 최소 크기 보장 */
  border: none;
  background: transparent;  /* 투명 배경으로 변경하여 일관성 확보 */
  border-radius: 8px;  /* var(--radius-md)에서 8px로 통일 */
  cursor: pointer;
  display: inline-flex;  /* inline-flex로 변경 */
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 1.25rem;  /* 이모지 크기 일관성 */
  line-height: 1;  /* 라인 높이 정규화 */
  padding: 0;  /* 패딩 제거하여 정렬 개선 */
  flex-shrink: 0;  /* 크기 축소 방지 */
  opacity: 0.7;  /* 기본 투명도 설정 */
}
.btn-icon:hover {
  background: rgba(0, 0, 0, 0.05);  /* 호버 배경 통일 */
  opacity: 1;  /* 호버 시 완전 불투명 */
  transform: scale(1.05);  /* 호버 시 미세한 확대 효과 */
}

/* --- Navigation --- */
.nav-btn {
  background: none;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--gray-600);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  border-bottom: 2px solid transparent;
}
.nav-btn:hover {
  background-color: var(--gray-100);
  color: var(--gray-900);
}
.nav-btn.active {
  color: var(--dm-text-primary, #1f2937);
  font-weight: 600;
  background: transparent;
  border-bottom: 2px solid var(--dm-primary, #3b82f6);
  border-radius: 0;
}

/* 다크 모드 */
[data-theme="dark"] .nav-btn.active,
.dark .nav-btn.active {
  color: #f9fafb;
  border-bottom-color: #60a5fa;
}

/* 네비게이션 링크 스타일 */
.nav-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-link:hover {
  text-decoration: none;
}

/* --- User Profile --- */
.user-profile-dropdown {
  position: relative;
}
.user-avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  background-color: var(--gray-200);
  border: 1px solid var(--gray-300);
  padding: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.user-avatar.placeholder {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray-700);
}
.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background-color: var(--dm-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 200px;
  z-index: 1100; /* 하단 고정 내비게이션(z-index:1000)보다 위 */
  border: 1px solid var(--gray-200);
  overflow: hidden;
}
.user-menu a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--dm-text-primary);
  text-decoration: none;
}
.user-menu a:hover {
  background-color: var(--gray-100);
}
.user-menu .danger {
  color: var(--error-600);
}
.user-menu .danger:hover {
  background-color: var(--error-50);
}
.user-info {
  padding: 1rem;
  border-bottom: 1px solid var(--gray-200);
  background-color: var(--dm-surface);
  color: var(--dm-text-primary);
}

/* --- View Header (페이지 공통 헤더) --- */
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}
.view-header h2 {
  font-size: 1.75rem;
  color: var(--gray-800);
  margin: 0;
}
.view-actions {
  display: flex;
  gap: 0.75rem;
}

/* --- Stat Cards --- */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--dm-surface);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-icon {
  font-size: 1.75rem;
  width: 50px;
  height: 50px;
  background: var(--dm-surface);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dm-primary);
}
.stat-content h3 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--dm-text-primary);
}
.stat-content h3 small {
  font-size: 0.7em;
  font-weight: 500;
  color: var(--gray-500);
  margin-left: 0.2em;
}
.stat-content p {
  color: var(--dm-text-secondary);
  margin: 0;
  font-weight: 500;
}

/* --- Empty State (Daily Moment Design) --- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--dm-text-secondary);
  background: var(--dm-surface);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e7eb;
}

.empty-state h3 {
  color: var(--dm-text-primary);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.empty-state p {
  color: var(--dm-text-secondary);
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* Empty State with Journey Illustration */
.empty-state-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  text-align: center;
  padding: 4rem 2rem;
  background: var(--dm-surface);
  border-radius: 24px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  border: 1px solid #f3f4f6;
}

.empty-state-illustration {
  width: 200px;
  height: 200px;
  background: var(--dm-surface);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  margin-bottom: 1rem;
}

.empty-state-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--dm-text-primary);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.empty-state-subtitle {
  font-size: 1rem;
  color: var(--dm-text-secondary);
  margin-bottom: 3rem;
  max-width: 400px;
}

.empty-state-cta {
  background: var(--dm-primary);
  color: white;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-size: 1.125rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.empty-state-cta:hover {
  background: #5b21b6;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.empty-state-guide {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid #e5e7eb;
}

.guide-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  text-align: left;
}

.guide-step-icon {
  width: 48px;
  height: 48px;
  background: var(--dm-surface);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.guide-step-content h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--dm-text-primary);
  margin-bottom: 0.5rem;
}

.guide-step-content p {
  font-size: 0.875rem;
  color: var(--dm-text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* ==========================================================================
     4. Page-Specific Styles (페이지별 스타일)
     ========================================================================== */

/* --- Dashboard Specific Styles --- */

/* 오늘의 목표 폼 래퍼 */
.dashboard-today-form {
  display: grid;
  grid-template-columns: 200px 1fr 140px 100px 80px; /* 목표선택, 텍스트(가변), 세션수, 길이, 버튼 */
  gap: 12px;
  align-items: center; /* 세로 가운데 정렬 */
}

.input-with-suggestions-wrapper {
    position: relative;
    grid-column: 2 / 3; /* Ensure it stays in the second column */
}

@media (max-width: 768px) {
  .dashboard-today-form {
    grid-template-columns: 1fr;
  }
}

/* 추가 버튼 컴포넌트 스타일 */
.btn-add {
  height: 44px;
  padding: 0 16px;
  font-size: 14px;
  line-height: 1;              /* 높이 계산 안정화 */
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;                    /* 아이콘-텍스트 간격 */
  box-sizing: border-box;
  flex: 0 0 auto;              /* flex 컨테이너에서도 늘어나지 않도록 */
  width: auto;                 /* 데스크톱 가변폭 */
}

@media (max-width: 768px) {
  .btn-add { width: 100%; height: 48px; }
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.date-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.date-nav-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--gray-200);
  background: var(--dm-surface);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--gray-600);
  font-size: 1.2rem;
}
.date-nav-btn:hover {
  background: var(--primary-100);
  color: var(--primary-600);
  border-color: var(--primary-200);
}
.current-date h2 {
  font-size: 1.5rem;
}
.current-date p {
  color: var(--gray-600);
}

/* Goals Section (Daily Moment Design) */
.goals-section {
  background: var(--dm-surface);
  border-radius: 24px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  border: 1px solid #f3f4f6;
  overflow: visible; /* 타이머 잘림 방지 */
}

.goals-header {
  padding: 2rem 2rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.goals-header h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--dm-text-primary);
  margin: 0;
}

.goals-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.goals-body {
  padding: 0 2rem 2rem;
}

/* New Goal Input Row (Daily Moment Design) */

.task-select {
  padding: 0.875rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 0.9rem;
  background: var(--dm-surface);
  color: var(--dm-text-primary);
  min-width: 200px;
  transition: all 0.2s ease;
  
  /* z-index를 매우 높게 설정하여 다른 요소에 가려지지 않도록 */
  position: relative;
  z-index: 9999 !important;
}

/* 추가: task-select의 부모 컨테이너들도 적절한 z-index와 overflow 설정 */
.add-goal-form {
  position: relative;
  z-index: 999;
}

.goals-body {
  position: relative;
  overflow: visible !important;
}

.goal-input-row {
  position: relative;
  overflow: visible !important;
}

.task-select:focus {
  outline: none;
  border-color: var(--dm-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.goal-name-input {
  padding: 0.875rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 0.9rem;
  background: var(--dm-surface);
  color: var(--dm-text-primary);
  width: 100%; /* 부모 컨테이너의 전체 너비 사용 */
  transition: all 0.2s ease;
}

.goal-name-input:focus {
  outline: none;
  border-color: var(--dm-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.goal-name-input::placeholder {
  color: var(--dm-text-secondary);
}

.session-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.session-input {
  width: 60px;
  padding: 0.75rem 0.5rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  text-align: center;
  background: var(--dm-surface);
}

.input-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.session-group {
  background: var(--dm-surface);
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  height: 44px;
  padding: 0.375rem 0.875rem; /* 좌우 여백 유지 */
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: fit-content;
  transition: all 0.2s ease;
}

.session-group:focus-within {
  border-color: var(--dm-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.session-group .session-input {
  border: none;
  padding: 0.5rem 0.25rem;
  width: 50px;
  background: transparent;
  height: 32px;        /* 그룹(44px) 안에서 적당한 내부 높이 */
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1;
}

.session-group .session-input:focus {
  box-shadow: none;
}

.input-suffix {
  font-size: 0.85rem;
  color: var(--gray-600);
  font-weight: 500;
  white-space: nowrap;
}

.session-label {
  font-size: 0.85rem;
  color: var(--gray-600);
  font-weight: 500;
}

.duration-select {
  padding: 0.875rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 0.9rem;
  background: var(--dm-surface);
  color: var(--dm-text-primary);
  min-width: 100px;
  transition: all 0.2s ease;
}

.duration-select:focus {
  outline: none;
  border-color: var(--dm-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 텍스트 입력/셀렉트 높이 통일 */
.task-select,
.goal-name-input,
.duration-select {
  height: 44px;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1;
}

.add-goal-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  background: var(--dm-primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.add-goal-btn:hover {
  background: #5b21b6;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
  background: var(--primary-600);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.add-goal-btn:hover {
  background: var(--primary-700);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.add-goal-btn .btn-icon {
  font-size: 0.9rem;
}

.add-goal-btn .btn-text {
  font-size: 0.9rem;
}

/* 기존 add-goal-form 스타일 제거를 위한 오버라이드 */
.add-goal-form {
  background: transparent;
  border: none;
  padding: 0;
  margin-bottom: 1.5rem;
}

/* Focus states */
.task-select:focus,
.goal-name-input:focus,
.session-input:focus,
.duration-select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.session-group:focus-within {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* Goal Cards (새로운 목표 카드 디자인) */
.goals-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* goal-card styles are defined in goal-card-redesign.css */

/* Goal Info Section */
.goal-info {
  margin-bottom: 1rem;
}

.goal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.goal-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray-800);
  margin: 0;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.parent-task-name {
  color: var(--gray-600);
  font-weight: 400;
  font-size: 0.9rem;
}

.title-divider {
  color: var(--gray-400);
  font-weight: 300;
  font-size: 0.8rem;
}

.daily-task-name {
  color: var(--gray-800);
  font-weight: 600;
  font-size: 1rem;
}

.goal-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.parent-task-badge {
  background: var(--primary-100);
  color: var(--primary-700);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--primary-200);
}

.completed-badge {
  background: var(--success-100);
  color: var(--success-700);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--success-200);
  white-space: nowrap;
}

/* Progress Section */
.goal-progress-section {
  margin-bottom: 1.25rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.progress-label {
  font-size: 0.9rem;
  color: var(--gray-600);
  font-weight: 500;
}

.progress-percentage {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-600);
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.progress-bar {
  width: 100%;
  height: 100%;
  position: relative;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-md);
  transition: width 0.3s ease;
  will-change: width;
}

.progress-bar.primary .progress-fill {
  background: var(--primary-500);
}

.progress-bar.warning .progress-fill {
  background: var(--warning-500);
}

.progress-bar.success .progress-fill {
  background: var(--success-500);
}

/* Goal Actions Section */
.goal-actions {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
}

/* Session Controls */
.session-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: transparent;
  padding: 0;
  border: none;
}

.session-controls.in-goal-card {
  background: var(--gray-50);
  padding: 0.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}

.session-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.session-btn.minus {
  background: var(--error-100);
  color: var(--error-600);
}

.session-btn.minus:hover:not(:disabled) {
  background: var(--error-500);
  color: white;
  transform: scale(1.1);
}

.session-btn.plus {
  background: var(--primary-100);
  color: var(--primary-600);
}

.session-btn.plus:hover {
  background: var(--primary-500);
  color: white;
  transform: scale(1.1);
}

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

.session-display {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  color: var(--gray-700);
}

.session-count {
  color: var(--primary-600);
  font-size: 1.1rem;
}

.session-target {
  color: var(--gray-500);
}

.session-divider {
  color: var(--gray-400);
  margin: 0 0.25rem;
}

.session-unit {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-left: 0.25rem;
}

/* Goal Meta */
.goal-meta {
  display: flex;
  justify-content: center;
}

.time-spent {
  background: var(--warning-50);
  color: var(--warning-700);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--warning-200);
}

/* Activity Record Section */
.activity-record-section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0;
}

.record-display {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.record-display:hover {
  background: var(--primary-50);
  border-color: var(--primary-300);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.record-icon {
  font-size: 1.1rem;
}

.record-value {
  font-weight: 600;
  color: var(--primary-700);
}

.record-unit {
  color: var(--gray-600);
  font-size: 0.9rem;
}

.record-placeholder {
  color: var(--gray-500);
  font-weight: 500;
}

/* Activity Record Modal */
.record-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--dm-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 1.5rem;
  width: 90%;
  max-width: 320px;
  z-index: 1100;
}

.record-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1050;
}

.record-modal h3 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  color: var(--gray-800);
}

.record-input-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.record-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 1rem;
  text-align: center;
  font-weight: 600;
}

.record-input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.unit-select {
  width: 100px;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

.record-quick-buttons {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.quick-record-btn {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-300);
  background: var(--dm-surface);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-record-btn:hover {
  background: var(--primary-50);
  border-color: var(--primary-300);
}

.record-modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* Goal Buttons */
.goal-buttons {
  display: flex;
  gap: 0.5rem;
}

.achievement-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.achievement-btn.pending {
  background: var(--gray-100);
  border: 2px solid var(--gray-300);
}

.achievement-btn.pending:hover {
  background: var(--success-100);
  border-color: var(--success-400);
  transform: scale(1.1);
}

.achievement-btn.achieved {
  background: var(--success-100);
  border: 2px solid var(--success-400);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.action-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.action-btn:hover {
  background: var(--gray-200);
  transform: scale(1.05);
}

.action-btn.edit:hover {
  background: var(--primary-100);
  color: var(--primary-600);
}

.action-btn.delete:hover {
  background: var(--error-100);
  color: var(--error-600);
}
.form-row {
  display: grid;
  grid-template-columns: 2fr 2fr 1fr 1fr auto;
  gap: 1rem;
  align-items: flex-end;
}
.form-label {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 0.25rem;
  display: block;
}
.form-row input,
.form-row select {
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  width: 100%;
}
.form-row input:focus,
.form-row select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 2px rgb(14 165 233 / 0.1);
}
.add-btn {
  background: var(--primary-500);
  color: white;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
}
.add-btn:hover {
  background: var(--primary-600);
}
.goals-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.goal-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all 0.3s ease;
}
.goal-item.completed {
  background: var(--success-50);
  border-left: 4px solid var(--success-500);
}

/* --- Tasks --- */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.task-item {
  background: var(--dm-surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.task-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.task-info h4 {
  margin-bottom: 0.25rem;
}
.task-meta {
  color: var(--gray-600);
  font-size: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}
.task-actions {
  display: flex;
  align-items: center;  /* 세로 중앙 정렬 추가 */
  gap: 0.75rem;  /* 아이콘 간격을 8-12px 권장에 맞게 조정 */
  height: 36px;  /* 명시적 높이 설정으로 정렬 기준 확보 */
}
.goal-progress,
.task-progress {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
}
.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--primary-500);
  transition: width 0.3s ease;
}
.progress-text {
  font-size: 0.875rem;
  color: var(--gray-600);
}

/* --- Statistics --- */
.stats-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.stats-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: white;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  padding: 0.6rem 2.5rem 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-800);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  min-width: 150px;
}
/* 통계 페이지 전용 그리드 - 다른 뷰와 충돌 방지를 위해 스코프 강화 */
.statistics-view-active .stats-grid,
#statistics-view.active .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: clamp(12px, 2vw, 24px);
  align-items: start;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
/* 통계 페이지 전용 차트 컨테이너 - 스코프 강화 */
.statistics-view-active .chart-container,
#statistics-view.active .chart-container {
  background: var(--dm-surface);
  border-radius: var(--radius-xl);
  padding: 1rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
  min-height: 450px; /* 차트들의 최소 높이를 늘려 여백 확보 및 균형 맞춤 */
}

/* 일간 트렌드 컨테이너는 자체 패딩 설정 사용 - 통계 뷰에서만 */
.statistics-view-active .chart-container.daily-trend-container,
#statistics-view.active .chart-container.daily-trend-container {
  padding: 20px 16px !important; /* 자체 최적화된 패딩 강제 적용 */
}

/* 모든 차트 컨테이너 동일 크기로 완전 통일 */
/* (삭제) 고정 높이/너비 강제 제거 - 스크립트 및 콘텐츠가 높이를 결정 */

/* 바 차트 캔버스 높이: 컨테이너에 맞춰 자동 조정 */
.chart-container h3 {
  margin-bottom: 1.5rem;
}
.chart-description {
  color: var(--gray-600);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
}
.heatmap-container {
  grid-column: 1 / -1;
  position: relative; /* 툴팁 위치 기준점 */
}
.heatmap-grid {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  gap: 4px;
}
.heatmap-cell {
  width: 15px;
  height: 15px;
  background-color: var(--gray-200);
  border-radius: 3px;
}
.heatmap-cell[data-level="1"] {
  background-color: #9be9a8;
}
.heatmap-cell[data-level="2"] {
  background-color: #40c463;
}
.heatmap-cell[data-level="3"] {
  background-color: #30a14e;
}
.heatmap-cell[data-level="4"] {
  background-color: #216e39;
}

/* 커스텀 툴팁 시스템 */
.heatmap-tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-100%) translateY(-8px);
  transition: opacity 0.15s ease-out;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.heatmap-tooltip.show {
  opacity: 1;
}

.heatmap-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
}

/* 히트맵 컨테이너는 위에서 이미 position: relative 설정됨 */

/* 호버 효과 강화 */
.heatmap-cell {
  cursor: pointer;
  transition: transform 0.1s ease-out, box-shadow 0.1s ease-out;
}

.heatmap-cell:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 10;
  position: relative;
}

/* 히트맵 범례 스타일 */
.heatmap-legend {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--gray-600);
}
.heatmap-legend div {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.heatmap-legend small {
  font-size: 0.75rem;
}

/* 통계 페이지 반응형 스타일 - 스코프 강화 */
@media (max-width: 768px) {
  .statistics-view-active .stats-grid,
  #statistics-view.active .stats-grid {
    grid-template-columns: 1fr;
    gap: clamp(10px, 3vw, 20px);
  }
  
  .statistics-view-active .daily-trend-container,
  .statistics-view-active .chart-container:not(.heatmap-container),
  #statistics-view.active .daily-trend-container,
  #statistics-view.active .chart-container:not(.heatmap-container) {
    min-height: 280px;
  }
  
  /* 차트 높이는 유연하게 반응하도록 자동 조정 */
  
  /* 히트맵 툴팁 모바일 최적화 */
  .heatmap-tooltip {
    font-size: 12px;
    padding: 6px 10px;
  }
  
  .heatmap-cell {
    width: 12px;
    height: 12px;
  }
  
  .heatmap-grid {
    gap: 3px;
  }
}

/* style.css 파일에 추가하세요 */

.guide-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.guide-section {
  background-color: white;
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.guide-section h2 {
  font-size: 1.5rem;
  color: var(--gray-800);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 1rem;
}

.guide-section h3 {
  font-size: 1.2rem;
  color: var(--gray-700);
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.guide-section p,
.guide-section li {
  color: var(--gray-600);
  line-height: 1.7;
}

.guide-section ul,
.guide-section ol {
  padding-left: 1.5rem;
}

.guide-section li {
  margin-bottom: 0.75rem;
}

.guide-section strong {
  color: var(--primary-700);
  font-weight: 600;
}

.example-box {
  background-color: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 1rem 0;
}
.example-box h4 {
  font-size: 1.1rem;
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--gray-800);
}
/* ==========================================================================
   Modal & Forms (모달 및 내부 폼 스타일)
   ========================================================================== */

/* --- Modal Shell (모달 기본틀) --- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background-color: var(--dm-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 550px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* 본문만 스크롤되도록 컨테이너는 숨김 */
  color: var(--dm-text-primary);
}

/* --- Modal Structure (모달 내부 구조) --- */
.modal-content form {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.modal-title {
  font-size: 1.25rem;
  margin: 0;
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.75rem;
  cursor: pointer;
  color: var(--gray-400);
}
.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1 1 auto; /* 본문만 스크롤, 하단 버튼 고정 */
  min-height: 0;  /* flex overflow 방지 */
}
.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  flex-shrink: 0;
}
.modal-footer .btn-secondary {
  background: var(--dm-surface, #ffffff);
  color: var(--dm-text-secondary, #6b7280);
  border: 1px solid var(--dm-border, #e5e7eb);
}
.modal-footer .btn-secondary:hover {
  background: var(--dm-hover, rgba(0, 0, 0, 0.05));
}
.modal-footer .btn-primary {
  background: var(--dm-primary, #3b82f6);
  color: white;
  border: none;
}
.modal-footer .btn-primary:hover {
  background: #2563eb;
}

/* 다크 모드 모달 버튼 */
html[data-theme="dark"] .modal-footer {
  border-color: rgba(255, 255, 255, 0.1);
}
html[data-theme="dark"] .modal-footer .btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #d1d5db;
  border-color: rgba(255, 255, 255, 0.1);
}
html[data-theme="dark"] .modal-footer .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}
html[data-theme="dark"] .modal-footer .btn-primary {
  background: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}
html[data-theme="dark"] .modal-footer .btn-primary:hover {
  background: #60a5fa;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .modal-footer {
    border-color: rgba(255, 255, 255, 0.1);
  }
  html:not([data-theme]) .modal-footer .btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #d1d5db;
    border-color: rgba(255, 255, 255, 0.1);
  }
  html:not([data-theme]) .modal-footer .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
  }
  html:not([data-theme]) .modal-footer .btn-primary {
    background: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  }
  html:not([data-theme]) .modal-footer .btn-primary:hover {
    background: #60a5fa;
  }
}

/* --- Form Layout & Base (폼 기본 레이아웃) --- */
.form-group {
  margin-bottom: 1.5rem;
}
.form-label,
.form-group legend {
  display: block;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: inherit;
  background-color: var(--dm-surface);
  color: var(--dm-text-primary);
}
.form-group input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 2px rgb(14 165 233 / 0.2);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* --- Custom Form Components (커스텀 폼 요소) --- */
.day-selector {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.day-selector input[type="checkbox"] {
  display: none;
}
.day-selector label {
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  transition: all 0.2s ease;
  user-select: none;
}
.day-selector input[type="checkbox"]:checked + label {
  background-color: var(--primary-600);
  border-color: var(--primary-600);
  color: white;
  font-weight: 600;
}

/* --- Smart Modal UI (스마트 모달 UI) --- */
.form-section {
  background-color: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.form-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.form-section-icon {
  font-size: 1.5rem;
}
.form-section-header h4 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--gray-800);
}
#calculated-end-date-info {
  font-size: 0.9rem;
  color: var(--gray-600);
  background-color: var(--gray-100);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}
#calculated-end-date-info strong {
  color: var(--primary-600);
  font-weight: 600;
}
.task-summary {
  background-color: var(--primary-50);
  border: 1px solid var(--primary-200);
  color: var(--primary-900);
  border-radius: var(--radius-lg);
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
  transition: all 0.3s ease;
}
.task-summary strong {
  font-weight: 600;
}

.day-selector-shortcuts {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.shortcut-btn {
  background-color: var(--gray-200);
  border: none;
  border-radius: var(--radius-md);
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  transition: background-color 0.2s;
}
.shortcut-btn:hover {
  background-color: var(--gray-300);
}

.day-selector {
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 0.5rem;
  display: flex;
  justify-content: space-between;
}

.day-selector label {
  flex: 1;
  text-align: center;
  border: none;
  padding: 0.6rem 0.2rem;
  margin: 0.1rem;
}
.day-selector input[type="checkbox"]:checked + label {
  background-color: var(--primary-600);
  border-color: var(--primary-600);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
  transform: scale(1.05);
}

/* ==========================================================================
     5. Modal Styles (모달 스타일)
     ========================================================================== */

/* Modal Overlay */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal.hidden {
  display: none;
}

/* Modal Content */
.modal-content {
  background: var(--dm-surface);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Modal Header */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-800);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-md);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background-color: var(--gray-100);
  color: var(--gray-600);
}

/* Modal Body */
.modal-body {
  padding: 1.5rem;
}

/* Modal Footer */
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.5rem;
  border-top: 1px solid var(--gray-200);
  background-color: var(--gray-50);
}

/* Form Styles for Modal */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* Day Selector */
.day-selector {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  padding: 0.75rem;
  background-color: var(--gray-50);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}

.day-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  background-color: white;
  border: 1px solid var(--gray-200);
}

.day-option:hover {
  background-color: var(--primary-50);
  border-color: var(--primary-200);
}

.day-option input {
  display: none;
}

.day-option span {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-700);
}

.day-option input:checked + span {
  color: white;
}

.day-option:has(input:checked) {
  background-color: var(--primary-600);
  border-color: var(--primary-600);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

/* End Date Display */
.end-date-display {
  background-color: var(--primary-50);
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-bottom: 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--primary-700);
}

.end-date-display strong {
  color: var(--primary-800);
  font-weight: 600;
}

.end-date-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.end-date-row .end-date-display {
  flex: 1;
  margin-bottom: 0;
}

.date-picker-btn {
  background: var(--dm-surface);
  border: 1px solid var(--primary-300);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  font-size: 1.1rem;
  min-width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.date-picker-btn:hover {
  background: var(--primary-50);
  border-color: var(--primary-400);
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.picker-icon {
  font-size: 1.1rem;
}

.end-date-picker.hidden {
  display: none;
}

.end-date-picker {
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.end-date-picker:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.end-date-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.end-date-picker {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.end-date-picker:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* Required Indicator */
.required-indicator {
  color: var(--error-500);
  font-weight: 600;
  margin-left: 0.25rem;
}

/* Field Error Messages */
.field-error {
  background-color: var(--error-50);
  border: 1px solid var(--error-200);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--error-700);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.field-error.hidden {
  display: none;
}

/* Day Selector Container */
.day-selector-container {
  width: 100%;
}

.day-selector-container.error .day-selector {
  border-color: var(--error-500);
  background-color: var(--error-50);
}

.day-selector-container.error .day-option {
  border-color: var(--error-300);
}

/* Task Summary */
.task-summary {
  background: var(--dm-surface);
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1rem;
}

.summary-content h4 {
  margin: 0 0 0.75rem 0;
  color: var(--primary-800);
  font-size: 1rem;
  font-weight: 600;
}

.summary-content p {
  margin: 0.5rem 0;
  color: var(--gray-700);
  font-size: 0.9rem;
  line-height: 1.5;
}


.summary-content .total-highlight {
  background-color: var(--success-100);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  font-weight: 600;
  color: var(--success-800);
  text-align: center;
  margin-top: 0.75rem;
}

/* ==========================================================================
     5.5. Dashboard Styles (대시보드 스타일)
     ========================================================================== */

/* Dashboard Header - 모던한 날짜 선택기 */
.dashboard-header {
  margin-bottom: 2.5rem;
  display: flex;
  justify-content: center;
}

.date-selector-modern {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  background: var(--dm-surface);
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-2xl);
  padding: 2rem 2.5rem;
  box-shadow: var(--shadow-lg);
  min-height: 100px;
  max-width: 800px;
  width: 100%;
}

.date-navigation {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex: 1;
}

.date-nav-btn {
  background: var(--dm-surface);
  border: 2px solid var(--primary-200);
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-md);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-700);
}

.date-nav-btn:hover {
  background: var(--primary-600);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-600);
}

.date-nav-btn:active {
  transform: translateY(0);
}

.date-display {
  flex: 1;
  text-align: center;
  max-width: 300px;
  margin: 0 auto;
}

.date-main {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.date-text {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary-800);
  text-shadow: 0 1px 3px rgba(0,0,0,0.1);
  letter-spacing: 0.5px;
}

.date-picker-hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  left: -9999px;
  /* 달력 버튼 클릭 시 임시로 보이게 될 위치 */
}

.datepicker-input-hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  left: -9999px;
  width: 1px;
  height: 1px;
}

/* Datepicker 팝업 위치 조정 */
.datepicker {
  position: absolute !important;
  z-index: 1050 !important;
}

/* 달력 버튼 근처에 datepicker 팝업 위치시키기 */
.date-quick-actions .datepicker {
  top: 100% !important;
  right: 0 !important;
  left: auto !important;
  margin-top: 0.5rem !important;
}

/* 모바일에서는 중앙 정렬 */
@media (max-width: 768px) {
  .date-quick-actions .datepicker {
    right: 50% !important;
    transform: translateX(50%) !important;
  }
}

/* Datepicker Dark Mode Support */
.datepicker-picker {
  background: var(--dm-surface) !important;
  color: var(--dm-text-primary) !important;
  border: 1px solid var(--gray-300) !important;
}

.datepicker-header {
  background: var(--dm-surface) !important;
  color: var(--dm-text-primary) !important;
  border-bottom: 1px solid var(--gray-300) !important;
}

.datepicker-footer {
  background: var(--dm-surface) !important;
  border-top: 1px solid var(--gray-300) !important;
}

.datepicker-controls .button,
.datepicker-controls .view-switch {
  background: var(--dm-surface) !important;
  color: var(--dm-text-primary) !important;
}

.datepicker-controls .button:hover,
.datepicker-controls .view-switch:hover {
  background: var(--gray-200) !important;
}

.datepicker-view .days-of-week {
  color: var(--dm-text-secondary) !important;
}

.datepicker-cell {
  color: var(--dm-text-primary) !important;
}

.datepicker-cell:hover {
  background: var(--gray-200) !important;
}

.datepicker-cell.selected,
.datepicker-cell.selected:hover {
  background: var(--primary-600) !important;
  color: white !important;
}

.datepicker-cell.today {
  background: var(--primary-100) !important;
  color: var(--primary-700) !important;
}

.datepicker-cell.today:hover {
  background: var(--primary-200) !important;
}

.datepicker-cell.prev,
.datepicker-cell.next {
  color: var(--gray-500) !important;
}

.datepicker-cell.disabled {
  color: var(--gray-400) !important;
}


.date-subtitle {
  font-size: 1.1rem;
  color: var(--primary-600);
  font-weight: 600;
}

.date-quick-actions {
  display: flex;
  gap: 0.75rem;
  position: relative;
}

.quick-btn {
  background: var(--dm-surface);
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-xl);
  padding: 1rem 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  color: var(--dm-text-primary);
  min-width: 100px;
  position: relative; /* 캘린더 위치 기준점 */
}

.quick-btn:hover {
  background: var(--primary-600);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-600);
}

.calendar-btn {
  background: var(--dm-surface);
  border-color: var(--warning-300);
  color: var(--warning-700);
}

.calendar-btn:hover {
  background: var(--warning-600);
  border-color: var(--warning-600);
  color: white;
}

.quick-icon {
  font-size: 1.2rem;
}

.quick-text {
  font-size: 1rem;
}

/* Stats Cards - 개선된 통계 카드 */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--dm-surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-2xl);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-500);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-300);
}

.stat-card:nth-child(1)::before {
  background: var(--primary-500);
}

.stat-card:nth-child(2)::before {
  background: var(--success-500);
}

.stat-card:nth-child(3)::before {
  background: var(--warning-500);
}

.stat-card:nth-child(4)::before {
  background: #8b5cf6;
}

.stat-icon {
  font-size: 2.5rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xl);
  background: var(--gray-100);
  flex-shrink: 0;
}

.stat-card:nth-child(1) .stat-icon {
  background: var(--primary-100);
  color: var(--primary-700);
}

.stat-card:nth-child(2) .stat-icon {
  background: var(--success-100);
  color: var(--success-700);
}

.stat-card:nth-child(3) .stat-icon {
  background: var(--warning-100);
  color: var(--warning-700);
}

.stat-card:nth-child(4) .stat-icon {
  background: #ede9fe;
  color: #7c3aed;
}

.stat-content {
  flex: 1;
}

.stat-content h3 {
  font-size: 2.25rem;
  font-weight: 800;
  margin: 0 0 0.25rem 0;
  color: var(--dm-text-primary);
  line-height: 1;
}

.stat-content p {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Goals Section */
.goals-section {
  background: var(--dm-surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-2xl);
  overflow: visible; /* 타이머 잘림 방지 */
  box-shadow: var(--shadow-md);
}

.goals-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  background: var(--dm-surface);
  border-bottom: 1px solid var(--gray-200);
}

.goals-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-800);
}

.goals-actions {
  display: flex;
  gap: 0.75rem;
}

.goals-body {
  padding: 2rem;
}

/* Add Goal Form */
.add-goal-form {
  background: var(--dm-surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.goal-input-row {
  display: grid;
  grid-template-columns: 1.2fr 2fr auto;
  gap: 0.75rem;
  align-items: end;
}

/* Mobile: keep single line */
@media (max-width: 768px) {
  .goal-input-row {
    grid-template-columns: 0.8fr 1.2fr auto !important;
    gap: 0.3rem !important;
  }
  
  .task-select, .goal-name-input {
    padding: 0.45rem 0.35rem !important;
    font-size: 0.8rem !important;
  }
  
  .add-goal-btn {
    padding: 0.45rem 0.6rem !important;
    font-size: 0.8rem !important;
    min-width: auto !important;
  }
  
  .add-goal-btn .btn-icon {
    font-size: 0.9rem !important;
  }
  
  .add-goal-btn .btn-text {
    display: none !important;
  }
}

.task-select, .goal-name-input, .session-input, .duration-select {
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.task-select:focus, .goal-name-input:focus, .session-input:focus, .duration-select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.session-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--dm-surface);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 0.5rem 0.75rem;
  min-width: 120px;
}

.session-input {
  border: none;
  padding: 0.25rem;
  width: 60px;
  text-align: center;
  font-weight: 600;
}

.input-suffix {
  font-size: 0.9rem;
  color: var(--gray-600);
  font-weight: 500;
}

.add-goal-btn {
  background: var(--primary-600) !important;
  color: white !important;
  border: none !important;
  border-radius: var(--radius-lg);
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.goals-body .add-goal-btn:hover,
.add-goal-form .add-goal-btn:hover,
button.add-goal-btn:hover {
  background: var(--primary-700) !important;
  color: white !important;
  transform: translateY(-1px) !important;
  box-shadow: var(--shadow-md) !important;
}

.goals-body .add-goal-btn:active,
.add-goal-form .add-goal-btn:active,
button.add-goal-btn:active {
  transform: translateY(0) !important;
  box-shadow: var(--shadow-sm) !important;
  background: var(--primary-800) !important;
  color: white !important;
}

.btn-icon {
  font-size: 1rem;
}

.btn-text {
  font-size: 0.9rem;
}

/* Goal Cards */
.goals-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 4px; /* Ensure first card hover effect is not clipped */
}

/* goal-card hover/completed styles are defined in goal-card-redesign.css */

.goal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.goal-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.parent-task-name {
  color: var(--gray-600);
  font-weight: 500;
}

.title-divider {
  color: var(--gray-400);
  font-weight: 400;
}

.daily-task-name {
  color: var(--primary-700);
  font-weight: 700;
}

.completed-badge {
  background: var(--dm-surface);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Progress Section */
.goal-progress-section {
  margin-bottom: 1.5rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.progress-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-600);
}

.progress-percentage {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-700);
}

.progress-bar-container {
  background: var(--gray-200);
  border-radius: var(--radius-md);
  height: 8px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-md);
  transition: all 0.5s ease;
}

/* Goal Actions */
.goal-actions {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  align-items: center;
}

.session-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
}

.session-btn {
  background: var(--dm-surface);
  border: 1px solid var(--gray-300);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.2s ease;
  color: var(--gray-700);
}

.session-btn:hover {
  background: var(--primary-600);
  color: white;
  border-color: var(--primary-600);
  transform: scale(1.1);
}

.session-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.session-display {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  color: var(--gray-800);
}

.session-count {
  font-size: 1.1rem;
  color: var(--primary-700);
}

.session-divider {
  color: var(--gray-400);
}

.session-target {
  color: var(--gray-600);
}

.session-unit {
  font-size: 0.9rem;
  color: var(--gray-500);
}

.goal-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--gray-600);
  font-weight: 500;
}

.activity-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--primary-600);
  font-weight: 600;
}

.goal-buttons {
  display: flex;
  gap: 0.5rem;
}

.achievement-btn, .action-btn {
  background: var(--dm-surface);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.achievement-btn.achieved {
  background: var(--dm-surface);
  color: white;
  border-color: var(--success-600);
}

.achievement-btn:hover, .action-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.action-btn.edit:hover {
  background: var(--warning-100);
  border-color: var(--warning-400);
}

.action-btn.delete:hover {
  background: var(--error-100);
  border-color: var(--error-400);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--gray-500);
}

.empty-state h3 {
  margin: 0 0 1rem 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.empty-state p {
  margin: 0;
  font-size: 1rem;
}

/* ==========================================================================
     7. Toast Notifications (토스트 알림)
     ========================================================================== */

.toast-container {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--dm-surface);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary-500);
  min-width: 300px;
  font-weight: 500;
  animation: slideInRight 0.3s ease-out;
  pointer-events: auto;
}

.toast.info {
  border-left-color: var(--primary-500);
  color: var(--primary-800);
  background: var(--dm-surface);
}

.toast.success {
  border-left-color: var(--success-500);
  color: var(--success-800);
  background: var(--dm-surface);
}

.toast.warning {
  border-left-color: var(--warning-500);
  color: var(--warning-800);
  background: var(--dm-surface);
}

.toast.error {
  border-left-color: var(--error-500);
  color: var(--error-800);
  background: var(--dm-surface);
}

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

@media (max-width: 768px) {
  .toast-container {
    top: 1rem;
    right: 1rem;
    left: 1rem;
  }
  
  .toast {
    min-width: auto;
  }
}

/* ==========================================================================
     9. Button Overrides (버튼 오버라이드)
     ========================================================================== */

/* 추가 버튼 호버 효과 강제 적용 */
#add-goal-btn,
button#add-goal-btn,
.add-goal-btn,
button.add-goal-btn {
  background: #0284c7 !important;
  color: #ffffff !important;
  border: none !important;
  opacity: 1 !important;
}

#add-goal-btn:hover,
button#add-goal-btn:hover,
.add-goal-btn:hover,
button.add-goal-btn:hover {
  background: #0369a1 !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1) !important;
  opacity: 1 !important;
}

#add-goal-btn:active,
button#add-goal-btn:active,
.add-goal-btn:active,
button.add-goal-btn:active {
  background: #1e3a8a !important;
  color: #ffffff !important;
  transform: translateY(0) !important;
  opacity: 1 !important;
}

#add-goal-btn .btn-icon,
#add-goal-btn .btn-text,
button#add-goal-btn .btn-icon,
button#add-goal-btn .btn-text,
.add-goal-btn .btn-icon,
.add-goal-btn .btn-text,
button.add-goal-btn .btn-icon,
button.add-goal-btn .btn-text {
  color: #ffffff !important;
  opacity: 1 !important;
}

/* ==========================================================================
     8. Responsive Design (모바일 대응)
     ========================================================================== */
@media (max-width: 900px) {
  /* 일반 form-row는 세로 배치 */
  .form-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    align-items: stretch;
  }
  .form-row > div {
    display: flex;
    flex-direction: column;
  }
  
  /* 중장기 목표 모달 전용: 시작일/마감일 가로 배치 */
  #task-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  #task-form .form-row input[type="date"] {
    font-size: 13px;
    padding: 8px 6px;
  }
  
  /* 중장기 목표 모달 전용: 세션 설정 가로 배치 */
  #task-form .task-session-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }
  #task-form .task-session-controls .session-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  #task-form .task-session-controls label {
    font-size: 11px;
    white-space: nowrap;
  }
  #task-form .task-session-controls select {
    font-size: 13px;
    padding: 8px 4px;
  }
  
  /* 요일 선택 한 줄 배치 */
  #task-form .day-selector {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
  }
  #task-form .day-option {
    padding: 6px 2px;
    min-width: 0;
  }
  #task-form .day-option span {
    font-size: 12px;
  }
  
  /* 모달 버튼 다크 모드 스타일 */
  .modal-footer {
    gap: 8px;
  }
  .modal-footer .btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    border-radius: 8px;
  }
  
  .add-btn {
    margin-top: 1rem;
    height: auto;
  }
  
  /* Dashboard Mobile Styles */
  .dashboard-header {
    margin-bottom: 2rem;
  }
  
  .date-selector-modern {
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
    min-height: auto;
    max-width: 100%;
  }
  
  .date-navigation {
    justify-content: center;
    gap: 1.5rem;
  }
  
  .date-nav-btn {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }
  
  .date-text {
    font-size: 1.5rem;
  }
  
  .date-subtitle {
    font-size: 1rem;
  }
  
  .date-quick-actions {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .quick-btn {
    padding: 0.75rem 1rem;
    min-width: 80px;
  }
  
  .stats-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .stat-card {
    padding: 1rem;
  }
  
  .stat-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
  }
  
  .stat-content h3 {
    font-size: 1.75rem;
  }
  
  .goals-body {
    padding: 1.5rem;
  }
  
  /* Goal Input Row - 모바일에서 2줄로 배치 */
  .goal-input-row {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(5, auto);
    gap: 0.75rem;
  }
  
  .session-group {
    min-width: auto;
    justify-content: center;
  }
  
  .goal-actions {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .session-controls {
    justify-content: center;
  }
  
  .goal-buttons {
    justify-content: center;
    gap: 1rem;
  }
  
  .task-select,
  .goal-name-input {
    min-width: auto;
    width: 100%;
  }
  
  .session-controls {
    justify-content: space-between;
    background: var(--gray-100);
    padding: 0.75rem;
    border-radius: var(--radius-md);
  }
  
  .duration-select {
    min-width: auto;
    width: 100%;
  }
  
  .add-goal-btn {
    justify-content: center;
    padding: 1rem;
  }
  
  /* Goal Cards - 모바일 반응형 */
  .goal-card {
    padding: 1rem;
  }
  
  .goal-actions {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .session-controls.in-goal-card {
    justify-content: center;
    padding: 1rem;
  }
  
  .session-group {
    justify-content: center;
    padding: 0.75rem;
    min-width: auto;
    flex: 1;
  }
  
  .goal-meta {
    order: -1; /* 시간 정보를 맨 위로 */
  }
  
  .goal-buttons {
    justify-content: center;
    gap: 1rem;
  }
  
  .achievement-btn,
  .action-btn {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }
  
  /* Modal responsive */
  .modal-content {
    max-width: 95vw;
    margin: 0.5rem;
  }
  
  .day-selector {
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
    padding: 0.5rem;
  }
  
  .day-option {
    padding: 0.5rem 0.25rem;
  }
  
  .day-option span {
    font-size: 0.8rem;
  }
}

@media (max-width: 768px) {
  .app-header {
    padding: 0 1rem;
  }
  .logo {
    font-size: 1.25rem;
  }
  .app-header .app-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--dm-surface);
    z-index: 1000;
    height: 60px;
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
    justify-content: space-around;
    gap: 0;
  }
  .app-nav .nav-btn {
    flex: 1;
    border-bottom: none;
    border-radius: 0;
    height: 100%;
  }
  .app-nav .nav-btn.active {
    background-color: transparent;
    border-bottom: 2px solid var(--dm-primary, #3b82f6);
  }
  /* 모바일에서도 프로필은 표시하고, 메뉴는 하단바 위로 펼침 */
  .user-profile-dropdown { position: relative; }
  .user-menu {
    top: auto !important;
    bottom: calc(100% + 10px) !important; /* 아바타 버튼 위로 표시 */
    right: 0 !important;
  }
  .app-main {
    padding: 1.5rem 1rem 70px 1rem;
  }
  .view-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  /* Groups: 모바일에서도 타이틀+버튼 한 줄 유지 */
  .groups-view-active .view-header {
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.5rem !important;
    flex-wrap: nowrap !important;
  }
  .groups-view-active .view-header h2 {
    font-size: 1.125rem !important;
    margin: 0;
    white-space: nowrap;
  }
  .groups-view-active .view-actions {
    display: flex;
    gap: 0.5rem !important;
    flex: 0 0 auto;
  }
  .groups-view-active .view-actions .btn {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
    white-space: nowrap;
  }
  
  /* Dashboard Mobile Specific */
  .dashboard-header {
    margin-bottom: 1.5rem;
  }
  
  .date-selector-modern {
    padding: 1rem;
    gap: 1rem;
  }
  
  .date-navigation {
    gap: 1rem;
  }
  
  .date-nav-btn {
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
  }
  
  .date-text {
    font-size: 1.25rem;
  }
  
  .date-subtitle {
    font-size: 0.9rem;
  }
  
  .quick-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    min-width: 70px;
  }
  
  .quick-icon {
    font-size: 1rem;
  }
  
  .stats-cards {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .stat-card {
    padding: 1rem;
    gap: 0.75rem;
  }
  
  .stat-icon {
    font-size: 1.75rem;
    width: 45px;
    height: 45px;
  }
  
  .stat-content h3 {
    font-size: 1.5rem;
  }
  
  .stat-content p {
    font-size: 0.85rem;
  }

  /* Tasks: 상태배지(status-text + d-day)를 모바일에서도 한 줄 유지 */
  .tasks-view-active .task-status-badge,
  #tasks-view.active .task-status-badge {
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.5rem !important;
    flex-wrap: nowrap !important;
  }
  .tasks-view-active .status-text,
  .tasks-view-active .d-day,
  #tasks-view.active .status-text,
  #tasks-view.active .d-day {
    white-space: nowrap !important;
  }
  
  /* Dashboard KPI: 모바일에서도 항상 1행(가로 스크롤) 유지 */
  .dashboard-view-active .stats-cards,
  #dashboard-view.active .stats-cards {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 0.5rem !important;
  }
  .dashboard-view-active .stat-card,
  #dashboard-view.active .stat-card {
    padding: 0.75rem !important;
    gap: 0.5rem !important;
  }
  .dashboard-view-active .stat-icon,
  #dashboard-view.active .stat-icon {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.25rem !important;
  }
  /* 모바일 대시보드: KPI 아이콘 숨김 */
  .dashboard-view-active .stat-icon,
  #dashboard-view.active .stat-icon {
    display: none !important;
  }
  .dashboard-view-active .stat-card,
  #dashboard-view.active .stat-card {
    justify-content: center !important;
  }
  .dashboard-view-active .stat-content,
  #dashboard-view.active .stat-content {
    text-align: center !important;
    margin: 0 auto !important;
  }
  .dashboard-view-active .stat-content h3,
  #dashboard-view.active .stat-content h3 {
    font-size: 1.125rem !important;
  }
  .dashboard-view-active .stat-content p,
  #dashboard-view.active .stat-content p {
    font-size: 0.65rem !important;
    line-height: 1.2 !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
    max-width: 100% !important;
    text-overflow: ellipsis !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }
  
  .goals-header {
    padding: 1rem 1.5rem;
  }
  
  .goals-body {
    padding: 1rem;
  }
  
  .add-goal-form {
    padding: 1rem;
  }
  
  .goal-card {
    padding: 1rem;
  }
  
  .session-btn {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }
  
  .achievement-btn, .action-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  
  /* Modal mobile styles */
  .modal {
    padding: 0.5rem;
    align-items: flex-start;
    padding-top: 2rem;
  }
  
  .modal-content {
    max-width: 100%;
    max-height: calc(100vh - 3rem);
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1rem;
  }
  
  .modal-footer {
    flex-direction: row !important; /* 모바일에서도 가로 배치 유지 */
    gap: 0.5rem;
  }
  
  .modal-footer .btn {
    width: 100%;
  }
}

/* ==========================================================================
   Enhanced Task List Styles (중장기 목표 리스트 개선된 스타일)
   ========================================================================== */
.task-item {
  background: var(--dm-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: all 0.3s ease;
  border-left: 4px solid var(--primary-500);
}

.task-item:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.task-item.active {
  border-left-color: var(--success-500);
}

.task-item.upcoming {
  border-left-color: var(--warning-500);
  background: var(--dm-surface);
}

.task-item.overdue {
  border-left-color: var(--error-500);
  background: var(--dm-surface);
}

/* 완료된 중장기 목표 스타일 */
.task-item.completed {
  border-left-color: var(--success-500);
  background: var(--dm-surface);
}

/* 보류 상태 목표 스타일 */
.task-item.on-hold {
  border-left-color: var(--warning-500);
  background: var(--dm-surface);
}

.task-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1rem 1.5rem 0;
}

.task-status-badge {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.status-text {
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--gray-100);
  color: var(--gray-700);
}

.task-item.active .status-text {
  background: var(--success-100);
  color: var(--success-700);
}

.task-item.upcoming .status-text {
  background: var(--warning-100);
  color: var(--warning-700);
}

.task-item.overdue .status-text {
  background: var(--error-100);
  color: var(--error-700);
}

.d-day {
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--primary-100);
  color: var(--primary-700);
  font-family: 'Courier New', monospace;
}

.d-day.urgent {
  background: var(--error-500);
  color: white;
  animation: pulse 2s infinite;
}

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

.task-actions {
  display: flex;
  align-items: center;  /* 세로 중앙 정렬 추가 */
  gap: 0.75rem;  /* 아이콘 간격을 8-12px 권장에 맞게 조정 */
  height: 36px;  /* 명시적 높이 설정으로 정렬 기준 확보 */
}

.task-main-content {
  padding: 1rem 1.5rem;
}

.task-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 1rem;
  line-height: 1.4;
}

/* 클릭 가능한 제목 스타일 - a 태그 기반 */
.task-title > a.clickable-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  position: relative;
  z-index: 1;            /* 장식 레이어보다 위 */
  padding: 8px 12px;     /* 기존 효과 유지 */
  border-radius: 8px;
  margin: -8px -12px;    /* 패딩 영역 확장 */
  transition: color .2s ease, transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.task-title > a.clickable-title:hover {
  color: var(--primary-700);
  text-decoration: underline;
  background: var(--primary-50);
  box-shadow: 0 2px 8px rgba(99,102,241,.1);
  transform: translateY(-1px);
}

/* 장식/오버레이가 클릭을 가로채지 않게 */
.task-card::before,
.task-card::after,
.task-card .card-overlay,
.task-card .progress-decoration {
  pointer-events: none;
}

.task-item::before,
.task-item::after,
.task-item .card-overlay,
.task-item .progress-decoration {
  pointer-events: none;
}

.task-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.75rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}

.meta-icon {
  font-size: 1.25rem;
  width: 2rem;
  text-align: center;
}

.meta-content {
  flex: 1;
}

.meta-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.125rem;
}

.meta-value {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-800);
}

.task-progress-section {
  padding: 1rem 1.5rem 1.5rem;
  background: transparent;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.progress-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
}

.progress-stats {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-600);
}

.progress-bar-container {
  position: relative;
}

.progress-bar {
  width: 100%;
  height: 2rem;
  background: var(--gray-200);
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
  height: 100%;
  background: var(--dm-surface);
  border-radius: var(--radius-xl);
  transition: all 0.5s ease;
  position: relative;
  overflow: hidden;
}

.progress-fill::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.3);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.progress-fill.very-low {
  background: var(--dm-surface);
}

.progress-fill.low {
  background: var(--dm-surface);
}

.progress-fill.medium {
  background: var(--dm-surface);
}

.progress-fill.high {
  background: var(--dm-surface);
}

.progress-fill.complete {
  background: var(--dm-surface);
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.875rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  z-index: 1;
}

/* Mobile optimization for activity record */
@media (max-width: 768px) {
  .activity-record-section {
    padding: 0.5rem 0;
  }
  
  .record-display {
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
  }
  
  .record-modal {
    width: 95%;
    padding: 1.25rem;
  }
  
  .goal-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* Mobile optimizations for enhanced task list */
@media (max-width: 768px) {
  .task-item {
    margin-bottom: 1rem;
    border-radius: var(--radius-lg);
  }
  
  .task-item-header {
    padding: 0.75rem 1rem 0;
  }
  
  .task-main-content {
    padding: 0.75rem 1rem;
  }
  
  .task-title {
    font-size: 1.125rem;
  }
  
  .task-meta-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .meta-item {
    padding: 0.5rem;
  }
  
  .task-progress-section {
    padding: 0.75rem 1rem 1rem;
  }
  
  .progress-bar {
    height: 1.5rem;
  }
  
  .progress-text {
    font-size: 0.75rem;
  }
  
  .task-status-badge {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
}

/* ==========================================================================
   Enhanced End Date Picker Styles (마감일 선택기 스타일)
   ========================================================================== */
.end-date-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  transition: all 0.3s ease;
}

.end-date-row:hover {
  background: var(--gray-100);
  border-color: var(--gray-300);
}

.end-date-display {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
}

.end-date-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.75rem;
}

.date-picker-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.1rem;
}

.date-picker-btn:hover {
  background: var(--primary-50);
  border-color: var(--primary-300);
  transform: scale(1.05);
}

.date-picker-btn:active {
  transform: scale(0.95);
}

.picker-icon {
  transition: transform 0.2s ease;
}

.date-picker-btn:hover .picker-icon {
  transform: scale(1.1);
}

.end-date-picker {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: var(--dm-surface);
  border: 2px solid var(--primary-300) !important;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  min-width: 180px;
  transition: all 0.2s ease;
  display: block !important;
}

.end-date-picker.hidden {
  display: none !important;
}

.end-date-picker:not(.hidden) {
  display: block !important;
}

/* 디버깅을 위한 강제 스타일 */
.date-picker-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.1rem;
}

.shortcut-btn {
  display: inline-block !important;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.day-selector-shortcuts {
  display: flex !important;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.day-selector-container {
  margin-top: 0.5rem;
}

.day-selector {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.day-option {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 3rem;
  justify-content: center;
}

.day-option:hover {
  background: var(--primary-50);
  border-color: var(--primary-300);
}

.day-option input[type="checkbox"] {
  display: none;
}

.day-option input[type="checkbox"]:checked + span,
.day-option:has(input[type="checkbox"]:checked) {
  background: var(--primary-500);
  color: white;
  border-color: var(--primary-600);
}

.day-option:has(input[type="checkbox"]:checked) {
  background: var(--primary-500);
  color: white;
  border-color: var(--primary-600);
}

/* 마감일 직접 설정 시 시각적 피드백 */
.end-date-display.custom-set {
  color: var(--primary-600);
  font-weight: 600;
}

.end-date-display.custom-set::before {
  content: '📅 ';
  margin-right: 0.25rem;
}

/* Mobile 최적화 */
@media (max-width: 768px) {
  .end-date-row {
    padding: 0.5rem;
    gap: 0.5rem;
  }
  
  .date-picker-btn {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
  }
  
  .end-date-picker {
    right: -0.5rem;
    left: -0.5rem;
    min-width: auto;
  }
}

/* ==========================================================================
   Day Selection Shortcuts Styles (실행 요일 선택 버튼 스타일)
   ========================================================================== */
.day-selector-shortcuts {
  display: flex !important;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.shortcut-btn {
  display: inline-block !important;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--gray-100) !important;
  border: 1px solid var(--gray-300) !important;
  border-radius: var(--radius-md);
  color: var(--gray-700) !important;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
}

.shortcut-btn:hover {
  background: var(--primary-50) !important;
  border-color: var(--primary-300) !important;
  color: var(--primary-700) !important;
  transform: translateY(-1px);
}

.shortcut-btn:active {
  transform: translateY(0);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 마감일 직접 설정 시 시각적 피드백 */
.end-date-display.custom-set {
  color: var(--primary-600);
  font-weight: 600;
}

.day-selector-container.error {
  border-color: var(--error-500) !important;
  background: var(--error-50) !important;
}

.field-error {
  color: var(--error-600);
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: var(--error-50);
  border: 1px solid var(--error-200);
  border-radius: var(--radius-md);
}

/* Task Summary Enhancement */
.task-summary {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--dm-surface);
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-lg);
}

.summary-content h4 {
  color: var(--primary-700);
  margin-bottom: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

.summary-content p {
  margin-bottom: 0.5rem;
  color: var(--gray-700);
  line-height: 1.5;
}

.summary-content .total-highlight {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--success-700);
  background: var(--dm-surface);
  padding: 0.5rem;
  border-radius: var(--radius-md);
  text-align: center;
  margin-top: 0.75rem;
  border: 1px solid var(--success-200);
}

/* ==========================================================================
   Group Detail View Styles (그룹 상세 뷰 스타일)
   ========================================================================== */
.group-detail-content {
  padding: 0;
  max-width: 100%;
  margin: 0;
}

.group-detail-content .view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--gray-200);
}

.group-detail-content .view-header h2 {
  margin: 0;
  color: var(--primary-700);
  flex: 1;
  text-align: center;
}

.header-left, .header-right {
  min-width: 120px;
}

.header-right {
  text-align: right;
}

.owner-badge {
  background: var(--dm-surface);
  color: white;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.group-info-card {
  background: var(--dm-surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

.info-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gray-100);
}

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

.info-item strong {
  min-width: 120px;
  color: var(--gray-700);
  font-weight: 600;
}

.invite-code {
  background: var(--primary-50);
  color: var(--primary-700);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-md);
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 1.1rem;
  border: 1px solid var(--primary-200);
}

.invite-link-display {
  background: var(--success-50);
  color: var(--success-700);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-md);
  font-family: 'Courier New', monospace;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid var(--success-200);
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-small {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

.copy-code-btn {
  background: var(--success-500);
  color: white;
  border: 1px solid var(--success-600);
  transition: all 0.2s ease;
}

.copy-code-btn:hover {
  background: var(--success-600);
  transform: translateY(-1px);
}

.group-stats-section {
  background: var(--dm-surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  color: var(--dm-text-primary);
}

.stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}


.group-stats-section h3 {
  margin: 0;
  color: var(--dm-text-primary);
  font-size: 1.25rem;
}

.stats-placeholder {
  text-align: center;
  padding: 2rem;
  color: var(--gray-500);
  font-style: italic;
}

/* Group Stats Styles (그룹 통계 스타일) */
.stats-overview {
  margin-bottom: 2rem;
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.summary-card {
  background: var(--dm-surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.summary-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.summary-icon {
  font-size: 2.5rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-50);
  border-radius: var(--radius-xl);
  border: 2px solid var(--primary-200);
}

.summary-content h4 {
  margin: 0 0 0.5rem 0;
  font-size: 0.875rem;
  color: var(--gray-600);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-700);
  margin: 0;
}

.stats-table {
  background: var(--dm-surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.stats-table h4 {
  margin: 0 0 1.5rem 0;
  color: var(--dm-text-primary);
  font-size: 1.25rem;
}

.ranking-table {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ranking-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--dm-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  transition: all 0.2s ease;
}

.ranking-row:hover {
  background: var(--gray-100);
  border-color: var(--color-primary, var(--primary-200));
}

.ranking-row.current-user {
  background: var(--dm-surface);
  border-color: var(--primary-400);
  box-shadow: var(--shadow-sm);
}

.ranking-row.current-user:hover {
  border-color: var(--primary-500);
  box-shadow: var(--shadow-md);
}

/* ===== 추가: 그룹 통계 랭킹 및 상세 표 스타일 ===== */
/* 랭킹 토글 영역 */
.group-ranking-section {
  margin-top: 1.5rem;
}

/* 차트 캔버스: 최대 높이를 제한하여 화면을 넘치지 않도록 함 */
.group-ranking-section canvas {
  width: 100%;
  max-height: 600px;
  display: block;
}
.ranking-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--gray-200);
}
.rank-toggle-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius-lg);
  background-color: transparent;
  color: var(--gray-700);
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
  border-bottom: 3px solid transparent;
}
.rank-toggle-btn:hover {
  color: var(--primary-500);
}
.rank-toggle-btn.active {
  color: var(--primary-600);
  border-bottom-color: var(--primary-500);
}

/* 상세 통계 테이블 */
.stats-table.large {
  margin-top: 1.5rem;
  overflow-x: auto;
}
.stats-table.large table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}
.stats-table.large th,
.stats-table.large td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.875rem;
  border-right: 1px solid var(--gray-200);
}

/* 마지막 열 우측 경계 제거 */
.stats-table.large th:last-child,
.stats-table.large td:last-child {
  border-right: none;
}
.stats-table.large th {
  background-color: var(--gray-100);
  color: var(--dm-text-primary);
  font-weight: 600;
}
.stats-table.large tbody tr:nth-child(odd) {
  background-color: var(--gray-50);
}
.stats-table.large tbody tr.current-user {
  background-color: rgba(59, 130, 246, 0.12);
}

.rank {
  font-size: 1.5rem;
  font-weight: 700;
  min-width: 40px;
  text-align: center;
}

.member-info {
  flex: 1;
}

.member-name {
  font-weight: 600;
  color: var(--dm-text-primary);
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

.member-stats {
  color: var(--dm-text-secondary);
  font-size: 0.875rem;
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 150px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--color-primary, #3b82f6);
  border-radius: var(--radius-lg);
  transition: width 0.8s ease;
}

.progress-text {
  font-weight: 600;
  color: var(--dm-text-primary);
  font-size: 0.875rem;
  min-width: 40px;
  text-align: right;
}

.stats-empty, .stats-error {
  text-align: center;
  padding: 3rem;
  color: var(--gray-500);
}

.empty-icon, .error-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.stats-empty h4, .stats-error h4 {
  margin: 0 0 0.5rem 0;
  color: var(--gray-700);
}

.stats-notice {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--warning-50);
  border: 1px solid var(--warning-200);
  border-radius: var(--radius-lg);
  text-align: center;
}

.stats-notice p {
  margin: 0;
  color: var(--warning-700);
  font-weight: 500;
}

.reload-stats-btn {
  margin-top: 1rem;
  background: var(--primary-500);
  color: white;
  border: none;
}

.reload-stats-btn:hover {
  background: var(--primary-600);
}

/* === Landing page styles === */
/* === Landing page styles (Refactored) === */
/* === Landing page styles (Refactored) === */
.landing-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  position: relative;
  text-align: center;
  background: transparent;
  color: #fff;
  overflow: hidden; /* No scroll on container itself */
}

.landing-header {
  position: absolute;
  top: 2rem;
  right: 2rem;
  z-index: 10;
}

.btn-pill-login {
  padding: 8px 24px;
  border-radius: 9999px;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.05);
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-pill-login:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.6);
}

/* Login Blur Effect */
body.login-blur .landing-container,
body.login-blur .landing-header {
  filter: blur(8px);
  pointer-events: none;
  transition: filter 0.5s ease;
}

.landing-content {
    /* Fixed header area - doesn't scroll */
    flex-shrink: 0; /* Don't shrink */
    position: relative;
    background: transparent;
    padding: 4rem 2rem 1rem;
    max-width: 700px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.landing-title {
  font-family: "Times New Roman", Times, serif; /* Elegant Serif */
  font-size: 4rem;
  font-weight: 400; /* Regular weight for elegance */
  color: #f8fafc;
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

.landing-input-container {
    position: relative;
    width: 100%;
    margin: 1rem 0;
    max-width: 600px;
}

.landing-goal-input {
    width: 100%;
    padding: 20px 32px;
    padding-right: 60px;
    border-radius: 999px; /* Pill shape */
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1); /* Translucent */
    font-size: 1.25rem;
    color: white;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(255,255,255,0.05);
}

.landing-goal-input:focus {
    border-color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.15);
    box-shadow: 0 0 30px rgba(255,255,255,0.1), inset 0 0 20px rgba(255,255,255,0.05);
}

.landing-goal-input::placeholder {
    color: rgba(255,255,255,0.4);
}

.landing-input-submit {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.landing-input-submit:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.landing-subtitle {
    font-size: 1rem;
    color: rgba(255,255,255,0.7);
    margin-top: 0.5rem;
    margin-bottom: 0; /* Remove bottom margin */
}

/* Guest Goals Container - Scrollable Area */
.guest-goals-list {
  flex: 1; /* Fill remaining space */
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  overflow-y: auto; /* Enable scrolling */
  overflow-x: hidden;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  /* Minimum height to ensure scrolling works */
  min-height: 0;
}

/* Scrollbar Styling for Goals List */
.guest-goals-list::-webkit-scrollbar {
  width: 8px;
}

.guest-goals-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.guest-goals-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  transition: background 0.2s;
}

.guest-goals-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Scrollbar for Light Mode (Main App) */
[data-theme="light"] .guest-goals-list::-webkit-scrollbar-track,
body:not([data-theme="dark"]) .guest-goals-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .guest-goals-list::-webkit-scrollbar-thumb,
body:not([data-theme="dark"]) .guest-goals-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .guest-goals-list::-webkit-scrollbar-thumb:hover,
body:not([data-theme="dark"]) .guest-goals-list::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

.guest-goal-card {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(10px);
  animation: slideUp 0.4s ease-out forwards;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.guest-goal-info h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: white;
  margin-bottom: 0.25rem;
  text-align: left;
}

.guest-goal-info p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
  text-align: left;
}

.guest-timer-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.guest-timer-btn:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

.guest-timer-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  margin-left: 2px; /* Visual correction for play icon */
}


@media (max-width: 600px) {
  .landing-title { font-size: 3rem; }
  .landing-goal-input { padding: 16px 24px; font-size: 1.1rem; }
}

/* 위험 버튼 (삭제) */
.btn-small.btn-danger {
  background-color: #dc2626;
  color: white;
}

.btn-small.btn-danger:hover:not(:disabled) {
  background-color: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

/* 경고 버튼 (탈퇴) */
.btn-small.btn-warning {
  background-color: #d97706;
  color: white;
}

.btn-small.btn-warning:hover:not(:disabled) {
  background-color: #b45309;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
}

/* 비활성 버튼 */
.btn-small.btn-disabled {
  background-color: var(--gray-300);
  color: var(--gray-500);
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-small.btn-disabled:hover {
  background-color: var(--gray-300);
  transform: none;
  box-shadow: none;
}

/* 에러 메시지 */
.error-message {
  color: #dc2626;
  font-size: 0.875rem;
  font-weight: 500;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
  .info-item-with-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .info-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* 그룹 활동 섹션 스타일 */
.group-activity-section {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.activity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.activity-header h3 {
  margin: 0;
  color: var(--gray-800);
  font-size: 1.1rem;
  font-weight: 600;
}

.activity-header-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* 격려 입력 섹션 */
.activity-input-section {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--dm-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-300);
}

.activity-input-section.hidden {
  display: none;
}

.encouragement-input {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.encouragement-input input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

.encouragement-input input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.quick-reactions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.quick-reaction-label {
  font-size: 0.875rem;
  color: var(--gray-600);
  font-weight: 500;
}

.quick-reaction-btn {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-300);
  background: var(--dm-surface);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-reaction-btn:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
  transform: translateY(-1px);
}

/* 활동 피드 */
.activities-feed {
  max-height: 400px;
  overflow-y: auto;
  border-radius: var(--radius-md);
  background: var(--dm-surface);
}

.activities-list {
  padding: 0.5rem;
}

.activity-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  transition: background-color 0.2s ease;
}

.activity-item:hover {
  background: var(--gray-50);
}

.activity-item.own-activity {
  background: rgba(59, 130, 246, 0.05);
  border-left: 3px solid var(--primary-500);
}

.activity-icon {
  font-size: 1.25rem;
  min-width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-message-with-time {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.activity-message {
  font-size: 0.9rem;
  color: var(--gray-800);
  line-height: 1.4;
  flex: 1;
  min-width: 0;
}

.activity-time {
  font-size: 0.8rem;
  color: var(--gray-500);
  white-space: nowrap;
  flex-shrink: 0;
}

.activity-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.activity-time {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.activity-reactions {
  display: flex;
  gap: 0.25rem;
}

.reaction-btn {
  padding: 0.25rem 0.5rem;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  opacity: 0.7;
}

.reaction-btn:hover {
  background: var(--gray-100);
  opacity: 1;
  transform: scale(1.1);
}

/* 빈 상태와 오류 상태 */
.activities-empty,
.activities-error,
.activities-loading {
  text-align: center;
  padding: 2rem;
  color: var(--gray-600);
}

.empty-icon,
.error-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.activities-empty h4,
.activities-error h4 {
  margin: 0 0 0.5rem 0;
  color: var(--gray-700);
}

.activities-empty p,
.activities-error p {
  margin: 0 0 1rem 0;
  font-size: 0.9rem;
}

/* 이모지 반응 및 댓글 스타일 */
.activity-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.reaction-btn {
  background: none;
  border: 1px solid var(--gray-300);
  border-radius: 20px;
  padding: 0.25rem 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.reaction-btn:hover {
  background-color: var(--gray-100);
  transform: translateY(-1px);
}

.reaction-btn.reacted {
  background-color: var(--primary-100);
  border-color: var(--primary-500);
}

.reaction-count {
  font-size: 0.8rem;
  color: var(--gray-600);
  font-weight: 500;
}

.comment-toggle-btn {
  background: none;
  border: none;
  color: var(--gray-600);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.comment-toggle-btn:hover {
  background-color: var(--gray-100);
  color: var(--gray-800);
}

.comments-list {
  margin-top: 0.75rem;
  padding-left: 3rem;
  border-left: 2px solid var(--gray-200);
}

.comment-item {
  padding: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--gray-700);
}

.comment-item strong {
  color: var(--gray-800);
  font-weight: 600;
}

.comment-time {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-left: 0.5rem;
}

.comment-input-section {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background-color: var(--gray-50);
  border-radius: 8px;
  display: flex;
  gap: 0.5rem;
}

.comment-input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  font-size: 0.875rem;
}

.comment-submit-btn {
  padding: 0.5rem 1rem;
  background-color: var(--primary-600);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.comment-submit-btn:hover:not(:disabled) {
  background-color: var(--primary-700);
}

.comment-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 주간 요약 스타일 */
.group-weekly-summary-section {
  background-color: var(--dm-surface);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--gray-200);
  color: var(--dm-text-primary);
}

.weekly-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.weekly-summary-header h3 {
  margin: 0;
  color: var(--dm-text-primary);
}

/* 주간 업데이트 정보 */
.weekly-update-info {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--gray-100);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  color: var(--dm-text-secondary);
}

.update-icon {
  font-size: 0.875rem;
}

.update-text {
  font-weight: 500;
}

.week-period {
  text-align: center;
  color: var(--dm-text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.last-update-time {
  text-align: center;
  color: var(--dm-text-secondary);
  font-size: 0.8rem;
  margin-bottom: 1rem;
  font-style: italic;
}

.last-update-time.pending {
  color: var(--warning-600);
  background: var(--warning-50);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-md);
  display: inline-block;
  font-weight: 500;
}

.week-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.highlight-card {
  background-color: var(--dm-surface);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  gap: 1rem;
  transition: transform 0.2s;
  border: 1px solid var(--gray-200);
}

.highlight-card:hover {
  transform: translateY(-2px);
}

.highlight-card.mvp,
.highlight-card.sessions,
.highlight-card.achievement,
.highlight-card.time {
  background: var(--dm-surface);
}

.highlight-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.highlight-content h4 {
  margin: 0 0 0.25rem 0;
  font-size: 0.875rem;
  color: var(--dm-text-primary);
}

.highlight-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dm-text-primary);
  margin: 0;
}

.highlight-detail {
  font-size: 0.75rem;
  color: var(--dm-text-secondary);
  margin: 0;
}

/* MVP 기준 표시 스타일 */
.mvp-criteria {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.criteria-icon {
  font-size: 0.875rem;
  opacity: 0.8;
  color: var(--dm-text-secondary);
}

.criteria-text {
  font-size: 0.75rem;
  color: var(--dm-text-secondary);
  font-weight: 500;
  line-height: 1.2;
}

.highlight-detail.trend.positive {
  color: var(--success-600);
}

.highlight-detail.trend.negative {
  color: var(--danger-600);
}

.week-leaderboard {
  margin-bottom: 1rem;
}

.week-leaderboard h4 {
  margin: 0 0 0.75rem 0;
  color: var(--gray-800);
}

.leaderboard-list {
  background-color: var(--dm-surface);
  border-radius: 8px;
  padding: 0.75rem;
  border: 1px solid var(--gray-200);
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.leaderboard-item:hover {
  background-color: var(--gray-100);
}

.leaderboard-item .rank {
  font-size: 1.25rem;
  width: 2rem;
}

.leaderboard-item .name {
  flex: 1;
  font-weight: 500;
  color: var(--gray-800);
}

.leaderboard-item .score {
  font-weight: 600;
  color: var(--primary-600);
}

.week-special-mention {
  background-color: var(--primary-50);
  border: 1px solid var(--primary-200);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  color: var(--primary-800);
}

.week-special-mention p {
  margin: 0;
}

.weekly-summary-empty,
.weekly-summary-error {
  text-align: center;
  padding: 2rem;
  color: var(--gray-600);
}

.update-schedule {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  display: inline-block;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
  .activity-header {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }
  
  .encouragement-input {
    flex-direction: column;
  }
  
  .quick-reactions {
    justify-content: center;
  }
  
  .activity-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .activity-reactions {
    align-self: flex-end;
  }
  
  .week-highlights {
    grid-template-columns: 1fr;
  }
  
  .activity-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.25rem;
  }
  
  .activity-reactions {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.25rem;
  }
  
  .reaction-btn {
    padding: 0.2rem 0.4rem;
    font-size: 1.1rem;
  }
  
  .comment-toggle-btn {
    padding: 0.2rem 0.4rem;
    font-size: 1.1rem;
    flex-shrink: 0;
  }
  
  .comment-input-section {
    flex-direction: column;
  }
}

/* 세션별 기록 모달 스타일 */
.record-modal {
  background: var(--dm-surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: 90%;
  max-width: 450px;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

.record-modal h3 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  color: var(--gray-900);
}

.record-subtitle {
  color: var(--gray-600);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.record-input-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.record-input {
  flex: 1;
  padding: 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.record-input:focus {
  border-color: var(--primary-500);
  outline: none;
}

.unit-select {
  padding: 0.75rem;
  font-size: 1rem;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--dm-surface);
  cursor: pointer;
}

.record-quick-buttons {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  justify-content: center;
}

.quick-record-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--dm-surface);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.quick-record-btn:hover {
  background: var(--primary-50);
  border-color: var(--primary-300);
  color: var(--primary-700);
}

/* 전체 기록 보기 모달 */
.records-list-modal {
  max-width: 550px;
}

.total-record-summary {
  background: var(--primary-50);
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summary-label {
  font-weight: 500;
  color: var(--gray-700);
}

.summary-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-700);
}

.session-records-list {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.session-record-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  background: var(--gray-50);
}

.session-label {
  font-weight: 500;
  color: var(--gray-700);
  min-width: 70px;
}

.record-value-group {
  display: flex;
  gap: 0.5rem;
  flex: 1;
}

.record-edit-value {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: 500;
}

.unit-edit-select {
  padding: 0.5rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--dm-surface);
}

.record-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.record-delete-btn:hover {
  opacity: 1;
}

.no-records {
  text-align: center;
  padding: 2rem;
  color: var(--gray-500);
}

/* 기록 표시 수정 */
.record-display {
  cursor: pointer;
  padding: 0.375rem 0.75rem;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition: all 0.2s;
  font-size: 0.875rem;
}

.record-display:hover {
  background: var(--primary-100);
  color: var(--primary-700);
}

.record-icon {
  font-size: 1rem;
}

.record-value {
  font-weight: 600;
}

.record-count {
  color: var(--gray-500);
  font-size: 0.75rem;
}

.record-placeholder {
  color: var(--gray-500);
  font-size: 0.875rem;
}

/* 저장 버튼 활성화 스타일 */
.btn.has-changes {
  background: var(--primary-600);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* 세션 컨트롤 수정 */
.activity-record-section {
  margin: 0 0.5rem;
}

/* 버튼 스타일 */
.btn-primary {
  padding: 0.625rem 1.25rem;
  background: var(--primary-600);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background: var(--primary-700);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

/* 탭 스타일 */
.tasks-header {
  margin-bottom: 2rem;
}

.tasks-header h2 {
  margin-bottom: 1rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--gray-200);
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--gray-900);
}

.tab-btn.active {
  color: var(--primary-600);
  font-weight: 600;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-600);
}

.tasks-controls {
  margin-bottom: 1.5rem;
}

/* 그룹 활동 상세 정보 스타일 */
.activity-detail {
  display: inline-block;
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-left: 0.5rem;
  font-style: italic;
}

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

/* ========= 도서 검색 관련 스타일 ========= */
.book-search-container {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.book-search-container input {
  flex: 1;
}

.book-search-container button {
  white-space: nowrap;
}

.book-search-results {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
}

.book-result-item {
  padding: 12px;
  cursor: pointer;
  border-bottom: 1px solid #e5e7eb;
  transition: background-color 0.2s;
}

.book-result-item:hover {
  background-color: #e5e7eb;
}

.book-result-item:last-child {
  border-bottom: none;
}

.book-title {
  font-weight: 600;
  color: #111827;
  margin-bottom: 4px;
}

.book-author {
  font-size: 14px;
  color: #6b7280;
}

.book-search-results .loading,
.book-search-results .no-results {
  padding: 20px;
  text-align: center;
  color: #6b7280;
}

/* 네이버 API 도서 검색 결과 스타일 */
.book-result-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.book-thumbnail {
  width: 60px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.book-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

/* 도서 검색 결과 내 책 제목 스타일 */
.book-search-results .book-title {
  font-weight: 600;
  color: #111827 !important;
  margin-bottom: 4px;
  text-align: left;
  font-size: 14px;
}

/* 도서 검색 결과 내 출판사 스타일 */
.book-search-results .book-publisher {
  font-size: 13px;
  color: #6b7280 !important;
  text-align: left;
}

.book-publisher {
  font-size: 13px;
  color: #9ca3af;
}

/* ========= 독서 목표 책장 UI 스타일 ========= */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  padding: 1rem;
}

.book-card {
  background: var(--dm-surface);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.book-cover {
  background: var(--dm-surface);
  color: white;
  padding: 2rem 1.5rem;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.book-cover[style*="background-image"] {
  padding: 0;
}

.book-cover[style*="background-image"]::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: var(--dm-surface);
}

.book-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 1rem;
  z-index: 1;
  text-align: center;
}

.book-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.book-author {
  font-size: 0.875rem;
  opacity: 0.9;
}

.book-progress {
  padding: 1rem 1.5rem;
  background: #f9fafb;
}

.book-progress .progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.book-progress .progress-fill {
  height: 100%;
  background: #10b981;
  transition: width 0.3s ease;
}

.book-progress .progress-text {
  font-size: 0.875rem;
  color: #6b7280;
  text-align: center;
}

.book-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 1px solid #e5e7eb;
}

.book-actions .btn-icon {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.book-actions .btn-icon:hover {
  background-color: #f3f4f6;
}

@media (max-width: 768px) {
  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }
  
  .book-cover {
    padding: 1.5rem 1rem;
    min-height: 120px;
  }
  
  .book-title {
    font-size: 1rem;
  }
}

/* 책 상태 오버레이 */
.book-status-overlay {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 1rem;
  z-index: 2;
  pointer-events: none;
}
.book-spine.on-hold {
  opacity: 0.9;
  transform: rotate(180deg);
}

/* ==========================================================================
   Daily Moment Goal Cards - New Design System
   ========================================================================== */

/* Today Goal Card - Modern Design */
.dm-goal-card {
  background: var(--dm-surface);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #f3f4f6;
  transition: all 0.2s ease;
}

.dm-goal-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  transform: translateY(-1px);
}

.dm-goal-card.completed {
  border-left: 4px solid var(--dm-success);
  background: var(--dm-surface);
}

/* 목표 카드 색상 시스템 */
.dm-goal-card[data-color="blue"] {
  background: var(--dm-surface);
  border-left: 4px solid #2196F3;
}

.dm-goal-card[data-color="green"] {
  background: var(--dm-surface);
  border-left: 4px solid #4CAF50;
}

.dm-goal-card[data-color="purple"] {
  background: var(--dm-surface);
  border-left: 4px solid #9C27B0;
}

.dm-goal-card[data-color="orange"] {
  background: var(--dm-surface);
  border-left: 4px solid #FF9800;
}

.dm-goal-card[data-color="pink"] {
  background: var(--dm-surface);
  border-left: 4px solid #E91E63;
}

.dm-goal-card[data-color="default"] {
  background: var(--dm-surface);
  border-left: 4px solid #9E9E9E;
}

/* Goal Card Header */
.dm-goal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.dm-goal-title-section {
  flex: 1;
}

.dm-goal-main-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--dm-text-primary);
  margin-bottom: 4px;
  line-height: 1.4;
}

.dm-goal-parent-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--dm-primary);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.dm-goal-completion-badge {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  background: var(--dm-success);
  color: white;
  flex-shrink: 0;
}

/* Progress Section - 개선된 레이아웃 */
.dm-goal-progress-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}

.dm-progress-container {
  flex: 1;
  margin-right: 16px;
  position: relative;
}

.dm-progress-text {
  position: absolute;
  top: -22px;
  right: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--dm-text-primary);
}

.dm-progress-bar {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.dm-progress-fill {
  height: 100%;
  background: var(--dm-surface);
  border-radius: 4px;
  transition: width 0.3s ease;
  position: relative;
}

.dm-progress-fill.overflow {
  background: var(--dm-surface);
}

.dm-goal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}


.dm-action-btn {
  width: 40px;
  height: 40px;
  border: 1px solid #e5e7eb;
  background: var(--dm-surface);
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dm-action-btn:hover {
  background: #f3f4f6;
  transform: translateY(-1px);
}


.dm-action-btn.edit {
  border-color: var(--dm-primary);
  color: var(--dm-primary);
}

.dm-action-btn.edit:hover {
  background: #f8fafc;
}

.dm-action-btn.delete {
  border-color: var(--dm-error);
  color: var(--dm-error);
}

.dm-action-btn.delete:hover {
  background: #fef2f2;
}

/* Goal Info Section */
.dm-goal-info {
  display: flex;
  align-items: center;
  gap: 20px;
}

.dm-session-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dm-session-display {
  font-size: 15px;
  color: var(--dm-text-primary);
  min-width: 100px;
  text-align: center;
}

.dm-session-count {
  font-weight: 600;
  font-size: 16px;
  color: var(--dm-text-primary);
}

.dm-session-divider {
  margin: 0 4px;
  color: var(--dm-text-secondary);
}

.dm-session-target {
  color: var(--dm-text-secondary);
}

.dm-session-unit {
  font-size: 13px;
  color: var(--dm-text-secondary);
  margin-left: 4px;
}

.dm-session-records-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #e5e7eb;
  background: var(--dm-surface);
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dm-session-records-btn:hover {
  background: #f3f4f6;
  transform: translateY(-1px);
}

.dm-record-display {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  min-height: 36px;
  color: var(--dm-text-primary);
  font-size: 14px;
}

.dm-time-display {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--dm-text-secondary);
  font-size: 14px;
  white-space: nowrap;
}

.dm-time-icon {
  font-size: 16px;
}

/* Session Chips */
.dm-session-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.dm-session-chip {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  font-weight: 500;
}

.dm-session-chip.complete {
  background: #dcfce7;
  color: #16a34a;
}

.dm-session-chip.incomplete {
  background: #fef3c7;
  color: #d97706;
}

/* Reading specific buttons */
.dm-reading-actions {
  display: flex;
  gap: 6px;
}

.dm-reading-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #e5e7eb;
  background: var(--dm-surface);
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dm-reading-btn:hover {
  background: #f3f4f6;
  transform: translateY(-1px);
}



/* 타이머 완료 순간 피드백 */
.dm-goal-card.completion-feedback {
  animation: completionFlash 2s ease-out forwards;
}

@keyframes completionFlash {
  0% {
    background: var(--dm-surface);
    transform: scale(1);
  }
  15% {
    background: var(--dm-surface);
    transform: scale(1.02);
  }
  30% {
    background: var(--dm-surface);
  }
  85% {
    background: var(--dm-surface);
    transform: scale(1.02);
  }
  100% {
    background: var(--dm-surface);
    transform: scale(1);
  }
}

/* 완료 체크 아이콘 애니메이션 */
.completion-check-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 64px;
  color: var(--dm-success);
  z-index: 10;
  animation: checkIconAnimation 2s ease-out forwards;
  opacity: 0;
  pointer-events: none;
}

@keyframes checkIconAnimation {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3) rotate(-180deg);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2) rotate(0deg);
  }
  30% {
    transform: translate(-50%, -50%) scale(0.9) rotate(0deg);
  }
  45% {
    transform: translate(-50%, -50%) scale(1.1) rotate(0deg);
  }
  60% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  85% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8) rotate(0deg);
  }
}

/* 진행률 바 완료 애니메이션 */
.dm-progress-fill.completion-animation {
  animation: progressComplete 1.5s ease-out forwards;
}

@keyframes progressComplete {
  0% {
    background: var(--dm-surface);
  }
  50% {
    background: var(--dm-surface);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
  }
  100% {
    background: var(--dm-surface);
  }
}

/* 세션 정보 업데이트 애니메이션 */
.session-completion-update {
  animation: sessionUpdate 1s ease-out;
}

@keyframes sessionUpdate {
  0% {
    transform: scale(1);
    color: var(--dm-text-primary);
  }
  50% {
    transform: scale(1.1);
    color: var(--dm-success);
    font-weight: 600;
  }
  100% {
    transform: scale(1);
    color: var(--dm-success);
  }
}

/* 반응형 디자인 */
@media (max-width: 768px) {

  /* Progress Bar 너비 조정 */
  .dm-progress-container {
    flex: 1;
    margin-right: 12px;
  }

  /* 카드 간격 조정 */
  .dm-goal-card {
    margin-bottom: 20px;
  }

  /* 완료 체크 아이콘 크기 조정 */
  .completion-check-icon {
    font-size: 48px;
  }
}

/* 접근성 - 애니메이션 감소 선호 사용자 대응 */
@media (prefers-reduced-motion: reduce) {
  
  .completion-check-icon {
    animation: none;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  
  
  .dm-goal-card.completion-feedback {
    animation: none;
    background: var(--dm-surface);
  }
}

/* ==========================================================================
   타이머 활성 상태 및 완료 피드백 스타일
   ========================================================================== */



/* 완료 배지 스타일 */
.dm-completion-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--dm-surface);
  border-radius: var(--radius-2xl);
  padding: 1.5rem 2rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  text-align: center;
  z-index: 100;
  animation: completionBadgeIn 0.5s ease-out;
}

@keyframes completionBadgeIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.dm-completion-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.dm-completion-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--dm-success);
  margin-bottom: 4px;
}

.dm-completion-details {
  font-size: 14px;
  color: var(--dm-text-secondary);
}

/* 파티클 효과 스타일 */
.dm-particle {
  position: fixed;
  pointer-events: none;
  font-size: 24px;
  animation: particleFly 2s ease-out forwards;
  z-index: 1000;
}

@keyframes particleFly {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-100px) rotate(360deg);
  }
}

/* ==========================================================================
   Color Theme System - Custom Color Theming
   ========================================================================== */

/* Custom theme cards */
.task-item.custom-theme,
.goal-card.custom-theme,
.dm-goal-card.custom-theme {
  background: var(--goal-bg, #ffffff) !important;
  border: 1px solid var(--goal-border, #e5e7eb) !important;
  color: var(--goal-text, #374151);
  transition: all 0.3s ease;
}

/* Custom theme card hover states */
.task-item.custom-theme:hover,
.goal-card.custom-theme:hover,
.dm-goal-card.custom-theme:hover {
  border-color: var(--goal-accent, #6366f1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

/* Custom theme completed cards */
.dm-goal-card.completed.custom-theme {
  background: var(--goal-bg, #ffffff) !important;
  border-left: 4px solid var(--goal-accent, var(--dm-success)) !important;
}

.task-item.custom-theme .meta-item {
  background: var(--goal-panel-bg, var(--gray-50));
  border-color: var(--goal-panel-border, var(--gray-200));
  color: var(--goal-panel-text, var(--gray-800));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.task-item.custom-theme .meta-icon {
  color: var(--goal-panel-text, var(--gray-800));
}

.task-item.custom-theme .meta-label {
  color: var(--goal-panel-muted, var(--gray-600));
}

.task-item.custom-theme .meta-value {
  color: var(--goal-panel-text, var(--gray-800));
}

.task-item.custom-theme .task-progress-section {
  background: transparent;
}

.task-item.custom-theme .progress-label,
.task-item.custom-theme .progress-stats {
  color: var(--goal-panel-muted, var(--gray-600));
}

.task-item.custom-theme .progress-bar {
  background: var(--goal-progress-bg, var(--gray-200));
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.08);
}

.task-item.custom-theme .progress-fill,
.task-item.custom-theme .progress-fill.very-low,
.task-item.custom-theme .progress-fill.low,
.task-item.custom-theme .progress-fill.medium,
.task-item.custom-theme .progress-fill.high,
.task-item.custom-theme .progress-fill.complete {
  background: var(--goal-accent, var(--primary-500));
}

.task-item.custom-theme .progress-text {
  color: var(--goal-progress-text, #ffffff);
}

/* Task card header styling for proper alignment */
.task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;  /* 세로 중앙 정렬 */
  margin-bottom: 1rem;
  min-height: 36px;  /* 최소 높이 보장 */
}

/* 중장기 목표 카드 날짜 정보 영역 */
.task-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Color picker trigger button */
.color-picker-trigger {
  width: 36px;
  height: 36px;
  min-width: 36px;  /* 최소 너비 보장 */
  min-height: 36px;  /* 최소 높이 보장 */
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;  /* inline-flex로 변경하여 정렬 개선 */
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0.7;
  flex-shrink: 0;  /* 크기 축소 방지 */
}

.color-picker-trigger:hover {
  background: rgba(0, 0, 0, 0.05);
  opacity: 1;
  transform: scale(1.05);  /* 호버 시 미세한 확대 효과 */
}

/* 중장기 목표 카드 액션 버튼 반응형 처리 */
@media (max-width: 768px) {
  .task-actions {
    gap: 0.5rem;  /* 모바일에서 간격 조정 */
  }
  
  .btn-icon,
  .color-picker-trigger {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    font-size: 1.1rem;  /* 모바일에서 약간 작게 */
  }
  
  .task-card-header {
    flex-wrap: nowrap;  /* 모바일에서도 한 줄 유지 */
  }
}

/* Color picker popover */
.color-picker-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  background: var(--dm-surface);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid #e5e7eb;
  padding: 24px;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  pointer-events: none;
  transition: all 0.2s ease;
}

/* 삭제 확인 모달 스타일 */
.delete-confirm-modal {
  max-width: 400px;
}

.goal-info-box {
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 8px;
  padding: 12px;
  margin: 16px 0;
  text-align: center;
}

.goal-info-box strong {
  display: block;
  color: #92400e;
  font-weight: 600;
  margin-bottom: 4px;
}

.goal-info-box small {
  color: #b45309;
  font-size: 12px;
}

.btn-danger {
  background: #ef4444;
  color: white;
  border: none;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.color-picker-popover.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* 헤더 스타일 */
.color-picker-header {
  margin-bottom: 20px;
}

.color-picker-header h4 {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 4px;
}

.color-picker-header p {
  font-size: 13px;
  color: #6b7280;
}

/* 색상 그룹 */
.color-group {
  margin-bottom: 16px;
}

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

.color-group-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 10px;
}

/* 색상 옵션 그리드 */
.color-options {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  max-width: 100%;
}

/* 개별 색상 옵션 */
.color-option {
  width: 40px;
  height: 40px;
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.color-option:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.color-option[aria-checked="true"] {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
  border-color: #6366f1;
}

.color-option[aria-checked="true"] .color-check {
  opacity: 1;
  transform: scale(1);
}

/* 체크 마크 */
.color-check {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  color: #1e293b;
  font-size: 16px;
  font-weight: bold;
  opacity: 0;
  transition: all 0.2s ease;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* 색상 라벨 */
.color-label {
  font-size: 11px;
  color: #6b7280;
  font-weight: 500;
}

/* 푸터 액션 */
.color-picker-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.cancel-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 80px;
}

.cancel-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #374151;
  transform: translateY(-1px);
}

.apply-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: #6366f1;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 80px;
}

.apply-btn:hover {
  background: #5b21b6;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.apply-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 팝오버 화살표 */
.color-picker-popover::before {
  content: '';
  position: absolute;
  top: -8px;
  right: 20px;
  width: 16px;
  height: 16px;
  background: var(--dm-surface);
  transform: rotate(45deg);
  box-shadow: -2px -2px 8px rgba(0, 0, 0, 0.05);
}

/* 다크 오버레이 */
.color-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.1);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.color-picker-overlay.active {
  opacity: 1;
  pointer-events: auto;
}


/* 모바일 반응형 */
@media (max-width: 640px) {
  .color-picker-popover {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 24px;
    transform: translateY(100%);
  }
  
  .color-picker-popover.active {
    transform: translateY(0);
  }
  
  .color-picker-popover::before {
    display: none;
  }
  
  .color-options {
    grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
    gap: 8px;
  }
  
  .color-option {
    width: 42px;
    height: 42px;
  }
  
}

/* ===== 무한 스크롤 스타일 ===== */
.loading-more {
  text-align: center;
  padding: 1rem;
  color: var(--gray-500);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-top: 1px solid var(--gray-200);
  margin-top: 1rem;
}

.loading-more::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid var(--gray-300);
  border-top: 2px solid var(--primary-500);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.load-more-section {
  text-align: center;
  padding: 1rem;
  border-top: 1px solid var(--gray-200);
  margin-top: 1rem;
  background: var(--gray-50);
}

.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--dm-surface);
  border: 2px solid var(--primary-500);
  color: var(--primary-600);
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.load-more-btn:hover {
  background: var(--primary-50);
  border-color: var(--primary-600);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.load-more-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.no-more-activities {
  text-align: center;
  padding: 1.5rem;
  color: var(--gray-400);
  font-size: 0.85rem;
  border-top: 1px solid var(--gray-200);
  margin-top: 1rem;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 활동 피드 컨테이너 최대 높이 및 스크롤 설정 */
#group-activities-feed {
  max-height: 500px;
  overflow-y: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  background: var(--dm-surface);
}

.activities-list {
  padding: 1rem;
}

/* 스크롤바 스타일링 */
#group-activities-feed::-webkit-scrollbar {
  width: 6px;
}

#group-activities-feed::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 3px;
}

#group-activities-feed::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 3px;
}

#group-activities-feed::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

/* 멤버 실행 기록 모달 스타일 */
.dm-modal[hidden] { 
  display: none; 
}

.dm-modal {
  position: fixed; 
  inset: 0; 
  background: rgba(0,0,0,.4);
  display: flex; 
  align-items: center; 
  justify-content: center; 
  z-index: 9999;
}

.dm-modal__dialog { 
  background: #fff; 
  width: min(1100px, 94vw); 
  max-height: 90vh; 
  overflow: auto; 
  border-radius: 12px; 
}

.dm-modal__header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  padding: 16px 20px; 
  border-bottom: 1px solid #eee; 
}

.dm-modal__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-600);
  padding: 0.25rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.dm-modal__close:hover {
  background: var(--gray-100);
  color: var(--gray-800);
}

.dm-modal__controls { 
  padding: 12px 20px; 
  border-bottom: 1px solid #f2f2f2; 
}

.dm-modal__controls label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--gray-700);
}

.dm-modal__controls select {
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--dm-surface);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dm-modal__controls select:hover {
  border-color: var(--gray-400);
}

.dm-modal__controls select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.dm-modal__body { 
  padding: 12px 20px 20px; 
}

.records-table { 
  width: 100%; 
  border-collapse: collapse; 
  font-size: 14px; 
}

.records-table th, 
.records-table td { 
  padding: 10px 8px; 
  border-bottom: 1px solid #f0f0f0; 
  text-align: left;
}

.records-table th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-700);
  font-size: 0.875rem;
}

.records-table td:nth-child(6) { 
  white-space: nowrap; 
}

.records-table tr:hover {
  background: var(--gray-50);
}

/* 멤버 이름 링크 스타일 */
.member-records-link { 
  background: none; 
  border: none; 
  color: #2563eb; 
  cursor: pointer; 
  text-decoration: underline; 
  padding: 0; 
  font-weight: inherit;
  font-size: inherit;
  transition: color 0.2s ease;
}

/* ===== Member Records Modal responsive tweaks ===== */
#member-records-modal .records-table {
  table-layout: fixed;
}

/* Keep the combined focus column on one line */
#member-records-modal .records-table td:nth-child(4) {
  white-space: nowrap;
}

/* Mobile: truncate long texts for long-term and today goal */
@media (max-width: 640px) {
  #member-records-modal .records-table th:nth-child(1),
  #member-records-modal .records-table td:nth-child(1) {
    width: 72px; /* fits MM-DD */
  }
  #member-records-modal .records-table th:nth-child(2),
  #member-records-modal .records-table td:nth-child(2),
  #member-records-modal .records-table th:nth-child(3),
  #member-records-modal .records-table td:nth-child(3) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.member-records-link:hover {
  color: #1d4ed8;
}

/* 상태 배지 스타일 */
.status-badge {
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
}

.status-완료 {
  background: #dcfce7;
  color: #15803d;
}

.status-부분완료 {
  background: #fef3c7;
  color: #d97706;
}

.status-미완료 {
  background: #f3f4f6;
  color: #6b7280;
}

/* 투명 텍스트 리셋 (그룹 통계 값) */
.group-stats .stat-content h3,
.group-stats .summary-value,
.text-solid {
  background: none !important;
  -webkit-text-fill-color: currentColor !important;
  color: var(--gray-900) !important;
}

/* ==========================================================================
   Footer Styles
   ========================================================================== */
.app-footer {
  background: var(--dm-surface);
  border-top: 1px solid var(--gray-200);
  padding: 24px 0;
  margin-top: 40px;
  color: var(--dm-text-secondary);
  font-size: 13px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-info {
  text-align: center;
}

.company-name {
  font-weight: 600;
  color: var(--dm-text-primary);
  margin-bottom: 12px;
  font-size: 16px;
  line-height: 1;
}

/* footer-top-row 안에서는 margin 제거 */
.footer-top-row .company-name {
  margin-bottom: 0;
}

.business-info,
.contact-info {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.business-info span,
.contact-info span {
  position: relative;
}

.business-info > span:not(:last-child)::after,
.contact-info > span:not(:last-child)::after {
  content: '|';
  margin-left: 10px;
  color: #cbd5e1;
}

@media (max-width: 768px) {
  .business-info,
  .contact-info {
    flex-direction: column;
    gap: 8px;
  }
  
  .business-info > span:not(:last-child)::after,
  .contact-info > span:not(:last-child)::after {
    display: none;
  }
  
  .app-footer {
    padding: 20px 0;
  }
  
  /* 모바일에서 데스크톱 전용 요소 숨김 */
  .app-footer .desktop-only {
    display: none !important;
  }
  
  /* 모바일에서 모바일 전용 요소 표시 */
  .app-footer .mobile-only {
    display: block !important;
  }
}

/* 기본적으로 모바일 전용 요소 숨김 */
.app-footer .mobile-only {
  display: none;
}

/* 푸터 상단 행 - Daily Moment과 버튼을 한 줄에 */
.footer-top-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* 사업자 정보 버튼 스타일 */
.business-info-btn {
  background: transparent;
  border: 1px solid var(--dm-text-secondary, #6b7280);
  color: var(--dm-text-secondary, #6b7280);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.business-info-btn:hover {
  border-color: var(--dm-primary, #6366f1);
  color: var(--dm-primary, #6366f1);
}

/* ==========================================================================
   Timer Immediate Response UI Styles
   ========================================================================== */

/* 타이머 시작 중 로딩 표시 */
.timer-loading-indicator {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  z-index: 10;
}

.timer-loading-indicator .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e5e7eb;
  border-top: 2px solid var(--dm-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 목표 카드 상태별 시각적 피드백 */
.goal-card.timer-starting {
  background-color: #f0f9ff;
  border-color: var(--dm-primary);
  transform: scale(1.01);
  transition: all 0.2s ease-in-out;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.goal-card.timer-pausing {
  background-color: #fef3c7;
  border-color: var(--dm-secondary);
  transition: all 0.3s ease-in-out;
}

.goal-card.timer-resuming {
  background-color: #dcfce7;
  border-color: var(--dm-success);
  transition: all 0.3s ease-in-out;
}

/* 버튼 상태별 스타일 */
.goal-card__timer.starting-timer {
  background-color: var(--dm-primary);
  color: white;
  transform: scale(0.98);
  transition: all 0.1s ease-in-out;
  cursor: not-allowed;
}

.goal-card__timer:disabled {
  opacity: 0.7;
  pointer-events: none;
}

/* 즉시 피드백 애니메이션 */
@keyframes buttonPulse {
  0% { transform: scale(1); }
  50% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.goal-card__timer.starting-timer,
.goal-card__timer:active {
  animation: buttonPulse 0.2s ease-in-out;
}

/* 성능 최적화를 위한 will-change 속성 */
.goal-card.timer-starting,
.goal-card.timer-pausing,
.goal-card.timer-resuming {
  will-change: background-color, border-color, transform;
}

.timer-loading-indicator .spinner {
  will-change: transform;
}

/* ==========================================================================
   Dashboard Date Navigation in Header (Overrides)
   ========================================================================== */
.goals-header {
  position: relative; /* Enable absolute positioning for children */
}

.goals-header .date-selector-modern {
  background: none;
  border: none !important;
  box-shadow: none !important;
  padding: 12px 0 24px 0; /* Add top/bottom padding */
  min-height: auto;
  width: auto;
  gap: 1rem;
  max-width: none;
  
  /* Center positioning */
  position: relative; /* Changed from absolute to fix layout collapse */
  margin: 0 auto;
  left: auto;
  transform: none;
}

.goals-header .date-navigation {
  gap: 0.5rem;
}

.goals-header .date-nav-btn {
  width: 32px;
  height: 32px;
  font-size: 1rem;
  border-width: 1px;
}

.goals-header .date-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

.goals-header .date-text {
  font-size: 1.1rem;
}

.goals-header .date-subtitle {
  font-size: 0.85rem;
  display: block; /* Show subtitle (day of week) */
  color: var(--gray-500);
  font-weight: 500;
  margin-top: 2px;
}

.goals-header .date-quick-actions {
  display: flex;
  gap: 0.5rem;
}

.goals-header .quick-btn {
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  min-width: auto;
}

.goals-header .quick-icon {
  font-size: 1rem;
}

.goals-header .quick-text {
  font-size: 0.8rem;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .goals-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  
  .goals-header .date-selector-modern {
    position: static; /* Reset absolute positioning */
    transform: none;
    width: 100%;
    justify-content: space-between;
  }
  
  .goals-header .date-text {
    font-size: 1rem;
  }
}

/* ==========================================================================
   Color Picker - Simplified Grid Layout (Google Calendar Style)
   ========================================================================== */

/* Simplified Color Grid */
.color-grid-simple {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 12px 0;
}

/* Color Swatch (Circular) */
.color-swatch {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.color-swatch:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.color-swatch:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.color-swatch[aria-checked="true"] {
  border-color: #202124;
}

/* Check Mark */
.color-grid-simple .color-check {
  opacity: 0;
  color: currentColor;
  font-size: 18px;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: opacity 0.2s ease;
}

.color-grid-simple .color-swatch[aria-checked="true"] .color-check {
  opacity: 1;
}

/* Custom Color Button */
.custom-color-btn {
  background: #f1f3f4 !important;
  border-color: #dadce0 !important;
}

.custom-color-btn:hover {
  background: #e8eaed !important;
}

.plus-icon {
  font-size: 24px;
  color: #5f6368;
  font-weight: 300;
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .color-grid-simple {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .color-swatch {
    width: 36px;
    height: 36px;
  }
}

/* 
   HOTFIX: Force Dark Mode for Statistics Page 
   statistics.css 변수가 적용되지 않는 문제 해결을 위해 전역 스타일에서 강제 주입
*/
html[data-theme="dark"] #statistics-view .stat-card,
html[data-theme="dark"] #statistics-view .chart-container,
html[data-theme="dark"] #statistics-view .stats-select,
html[data-theme="dark"] #statistics-view .stats-empty,
html[data-theme="dark"] #statistics-view .stats-error {
  background-color: #1f2937 !important; /* var(--dm-surface) 값 직접 지정 */
  border-color: #374151 !important;     /* var(--dm-border) 값 직접 지정 */
  color: #f9fafb !important;            /* var(--dm-text-primary) 값 직접 지정 */
}

/* 통계 페이지 텍스트 색상 강제 지정 */
html[data-theme="dark"] #statistics-view h2,
html[data-theme="dark"] #statistics-view h3,
html[data-theme="dark"] #statistics-view .stat-content h3,
html[data-theme="dark"] #statistics-view .chart-container h3,
html[data-theme="dark"] #statistics-view .stats-header h2 {
  color: #f9fafb !important;
}

html[data-theme="dark"] #statistics-view p,
html[data-theme="dark"] #statistics-view small,
html[data-theme="dark"] #statistics-view .chart-description,
html[data-theme="dark"] #statistics-view .stat-content p,
html[data-theme="dark"] #statistics-view .stat-content small {
  color: #d1d5db !important; /* var(--dm-text-secondary) 값 직접 지정 */
}

/* 통계 페이지 스크롤바 강제 지정 */
html[data-theme="dark"] #statistics-view .heatmap-wrapper::-webkit-scrollbar {
  background: #1f2937 !important;
}

html[data-theme="dark"] #statistics-view .heatmap-wrapper::-webkit-scrollbar-thumb {
  background: #4b5563 !important;
}

/* ==========================================================================
   Global Dark Mode Scrollbar Styles
   ========================================================================== */
html[data-theme="dark"],
html[data-theme="dark"] body,
html.dark,
html.dark body {
  scrollbar-width: thin;
  scrollbar-color: #374151 #111827;
}

html[data-theme="dark"]::-webkit-scrollbar,
html[data-theme="dark"] body::-webkit-scrollbar,
html[data-theme="dark"] *::-webkit-scrollbar,
html.dark::-webkit-scrollbar,
html.dark body::-webkit-scrollbar,
html.dark *::-webkit-scrollbar {
  width: 8px;
  height: 8px;
  background-color: #111827;
}

html[data-theme="dark"]::-webkit-scrollbar-track,
html[data-theme="dark"] body::-webkit-scrollbar-track,
html[data-theme="dark"] *::-webkit-scrollbar-track,
html.dark::-webkit-scrollbar-track,
html.dark body::-webkit-scrollbar-track,
html.dark *::-webkit-scrollbar-track {
  background-color: #111827;
}

html[data-theme="dark"]::-webkit-scrollbar-thumb,
html[data-theme="dark"] body::-webkit-scrollbar-thumb,
html[data-theme="dark"] *::-webkit-scrollbar-thumb,
html.dark::-webkit-scrollbar-thumb,
html.dark body::-webkit-scrollbar-thumb,
html.dark *::-webkit-scrollbar-thumb {
  background-color: #374151;
  border-radius: 4px;
}

html[data-theme="dark"]::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] body::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] *::-webkit-scrollbar-thumb:hover,
html.dark::-webkit-scrollbar-thumb:hover,
html.dark body::-webkit-scrollbar-thumb:hover,
html.dark *::-webkit-scrollbar-thumb:hover {
  background-color: #4b5563;
}

/* Goal Edit Modal Styles (Moved from HTML to external CSS for reliability) */
#goalEditModal .goal-edit-readonly {
  background-color: var(--color-bg-tertiary, #f9fafb);
  color: var(--color-text-secondary, #6b7280);
  cursor: not-allowed;
}

#goalEditModal .goal-edit-summary {
  display: none; 
  margin-top: 20px; 
  padding: 16px; 
  background: var(--color-bg-info, #f0f9ff); 
  border-radius: 8px; 
  border-left: 4px solid #0ea5e9;
}

#goalEditModal .goal-edit-summary-text {
  margin: 0; 
  font-size: 14px; 
  color: var(--color-text-primary, #374151);
}

#goalEditModal .goal-edit-footer {
  padding: 20px 24px; 
  background: var(--color-bg-secondary, #ffffff); 
  border-top: 1px solid var(--color-border-primary, #e5e7eb);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

#goalEditModal .goal-edit-footer .modal-btn {
  height: 44px !important;
  padding: 0 24px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  min-width: 80px;
}

/* Dark Mode Overrides for Goal Edit Modal */
html[data-theme="dark"] #goalEditModal .goal-edit-readonly,
.dark #goalEditModal .goal-edit-readonly {
  background-color: var(--color-bg-tertiary, #374151);
  color: var(--color-text-secondary, #9ca3af);
  border-color: var(--color-border-primary, #4b5563);
}

html[data-theme="dark"] #goalEditModal .goal-edit-summary,
.dark #goalEditModal .goal-edit-summary {
  background: rgba(14, 165, 233, 0.15) !important;
  border-left-color: #0ea5e9;
}

html[data-theme="dark"] #goalEditModal .goal-edit-summary-text,
.dark #goalEditModal .goal-edit-summary-text {
  color: var(--color-text-secondary, #d1d5db);
}

html[data-theme="dark"] #goalEditModal .goal-edit-footer,
.dark #goalEditModal .goal-edit-footer {
  background: var(--color-bg-secondary, #1f2937);
  border-top-color: var(--color-border-primary, #374151);
}

html[data-theme="dark"] #goalEditModal .modal-title,
.dark #goalEditModal .modal-title {
  color: var(--color-text-primary, #f9fafb);
}

/* Fix Goal Summary Header Text Color in Dark Mode */
html[data-theme="dark"] #goalEditModal .goal-edit-summary h4,
.dark #goalEditModal .goal-edit-summary h4 {
  color: var(--color-text-primary, #f9fafb) !important;
}

/* Goal Edit Modal 3-Column Layout for Mobile */
#goalEditModal .goal-session-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

#goalEditModal .goal-session-controls .session-field {
  margin-bottom: 0;
}

/* Adjust labels for small screens */
@media (max-width: 400px) {
  #goalEditModal .profile-form-label {
    font-size: 12px;
    letter-spacing: -0.5px;
  }
  #goalEditModal .profile-form-select {
    padding-left: 8px;
    padding-right: 24px; /* Adjust for arrow */
    font-size: 13px;
  }
}

/* Force 3-Column Grid for Session Controls */
#goalEditModal .goal-session-controls {
  display: grid !important;
  grid-template-columns: 1fr 1fr 1fr !important;
  gap: 10px !important;
  align-items: end !important;
}

/* Override potential block display on children */
#goalEditModal .goal-session-controls .session-field {
  width: auto !important;
  margin-bottom: 0 !important;
  display: block !important; /* Ensure it's not flex if that messes up grid item? Block is fine as item */
}

/* STRICT Dark Mode Override for Goal Summary */
html[data-theme="dark"] #goalEditModal .goal-edit-summary,
.dark #goalEditModal .goal-edit-summary {
  background: #1e293b !important; /* Dark Slate Background */
  background-color: #1e293b !important;
  border-left: 4px solid #0ea5e9 !important;
  color: #e2e8f0 !important;
}

html[data-theme="dark"] #goalEditModal .goal-edit-summary .goal-edit-summary-text,
.dark #goalEditModal .goal-edit-summary .goal-edit-summary-text {
  color: #e2e8f0 !important; /* Light Text */
}
html[data-theme="dark"] #goalEditModal .goal-edit-summary h4,
.dark #goalEditModal .goal-edit-summary h4 {
  color: #ffffff !important; /* Pure White Title */
}

/* Force remove borders for date header cleanup */
.goals-header, 
.goals-section,
.date-navigation,
.goals-header .date-display {
  border: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
}

/* Ensure padding for date box */
.goals-header .date-selector-modern {
  padding-top: 16px !important;
  padding-bottom: 24px !important;
}

/* 중장기 목표 모달 버튼 다크 모드 스타일 (최종 오버라이드) */
html[data-theme="dark"] #task-form .modal-footer .btn-secondary,
html[data-theme="dark"] .modal-content .modal-footer .btn.btn-secondary {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #d1d5db !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}
html[data-theme="dark"] #task-form .modal-footer .btn-secondary:hover,
html[data-theme="dark"] .modal-content .modal-footer .btn.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}
html[data-theme="dark"] #task-form .modal-footer .btn-primary,
html[data-theme="dark"] .modal-content .modal-footer .btn.btn-primary {
  background: #3b82f6 !important;
  color: white !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3) !important;
}
html[data-theme="dark"] #task-form .modal-footer .btn-primary:hover,
html[data-theme="dark"] .modal-content .modal-footer .btn.btn-primary:hover {
  background: #60a5fa !important;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) #task-form .modal-footer .btn-secondary,
  html:not([data-theme]) .modal-content .modal-footer .btn.btn-secondary {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #d1d5db !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
  }
  html:not([data-theme]) #task-form .modal-footer .btn-secondary:hover,
  html:not([data-theme]) .modal-content .modal-footer .btn.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1) !important;
  }
  html:not([data-theme]) #task-form .modal-footer .btn-primary,
  html:not([data-theme]) .modal-content .modal-footer .btn.btn-primary {
    background: #3b82f6 !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3) !important;
  }
  html:not([data-theme]) #task-form .modal-footer .btn-primary:hover,
  html:not([data-theme]) .modal-content .modal-footer .btn.btn-primary:hover {
    background: #60a5fa !important;
  }
}


/* 모달 버튼 텍스트 중앙 정렬 */
html[data-theme="dark"] #task-form .modal-footer .btn,
html[data-theme="dark"] .modal-content .modal-footer .btn {
  text-align: center !important;
  justify-content: center !important;
  display: flex !important;
  align-items: center !important;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) #task-form .modal-footer .btn,
  html:not([data-theme]) .modal-content .modal-footer .btn {
    text-align: center !important;
    justify-content: center !important;
    display: flex !important;
    align-items: center !important;
  }
}
/* 라이트 모드에서도 중앙 정렬 */
.modal-footer .btn {
  text-align: center !important;
  justify-content: center !important;
  display: flex !important;
  align-items: center !important;
}


/* 다크 모드에서 날짜 입력 달력 아이콘 가시성 */
html[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.5) !important;
  cursor: pointer;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.5) !important;
    cursor: pointer;
  }
}
/* 날짜 입력 필드 전체 클릭 가능 */
input[type="date"] {
  cursor: pointer;
}


/* ===== AI 목표 모달 다크 모드 스타일 ===== */
html[data-theme="dark"] #aiGoalModal .modal-container {
  background: var(--dm-surface, #1f2937) !important;
}
html[data-theme="dark"] #aiGoalModal .modal-header {
  background: var(--dm-surface, #1f2937) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
html[data-theme="dark"] #aiGoalModal .modal-title {
  color: #f9fafb !important;
}
html[data-theme="dark"] #aiGoalModal .modal-close-btn {
  color: #9ca3af !important;
}
html[data-theme="dark"] #aiGoalModal .ai-tabs {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
html[data-theme="dark"] #aiGoalModal .ai-tab-btn {
  color: #9ca3af !important;
}
html[data-theme="dark"] #aiGoalModal .ai-tab-btn.active {
  color: #3b82f6 !important;
  border-color: #3b82f6 !important;
}
html[data-theme="dark"] #aiGoalModal .info-box {
  background: rgba(59, 130, 246, 0.1) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
}
html[data-theme="dark"] #aiGoalModal .info-box h4 {
  color: #60a5fa !important;
}
html[data-theme="dark"] #aiGoalModal .info-box ol,
html[data-theme="dark"] #aiGoalModal .info-box li {
  color: #93c5fd !important;
}
html[data-theme="dark"] #aiGoalModal .form-label,
html[data-theme="dark"] #aiGoalModal label {
  color: #d1d5db !important;
}
html[data-theme="dark"] #aiGoalModal .form-input,
html[data-theme="dark"] #aiGoalModal .form-select,
html[data-theme="dark"] #aiGoalModal .form-textarea,
html[data-theme="dark"] #aiGoalModal input[type="text"],
html[data-theme="dark"] #aiGoalModal input[type="date"],
html[data-theme="dark"] #aiGoalModal select,
html[data-theme="dark"] #aiGoalModal textarea {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #f9fafb !important;
}
html[data-theme="dark"] #aiGoalModal input::placeholder,
html[data-theme="dark"] #aiGoalModal textarea::placeholder {
  color: #6b7280 !important;
}
html[data-theme="dark"] #aiGoalModal .generated-prompt-area {
  background: rgba(255, 255, 255, 0.05) !important;
}
html[data-theme="dark"] #aiGoalModal #ai-generated-prompt {
  background: rgba(0, 0, 0, 0.2) !important;
  color: #d1d5db !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
html[data-theme="dark"] #aiGoalModal .modal-footer {
  background: var(--dm-surface, #1f2937) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
html[data-theme="dark"] #aiGoalModal .modal-btn-secondary {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #d1d5db !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}
html[data-theme="dark"] #aiGoalModal .modal-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}
html[data-theme="dark"] #aiGoalModal #ai-preview-area {
  background: rgba(34, 197, 94, 0.1) !important;
  border-color: rgba(34, 197, 94, 0.3) !important;
}
html[data-theme="dark"] #aiGoalModal #ai-preview-area h4 {
  color: #4ade80 !important;
}
html[data-theme="dark"] #aiGoalModal #ai-preview-content {
  color: #86efac !important;
}
html[data-theme="dark"] #aiGoalModal .error-message {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #f87171 !important;
}
html[data-theme="dark"] #aiGoalModal input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.5) !important;
}
/* prefers-color-scheme dark */
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) #aiGoalModal .modal-container {
    background: var(--dm-surface, #1f2937) !important;
  }
  html:not([data-theme]) #aiGoalModal .modal-header {
    background: var(--dm-surface, #1f2937) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
  }
  html:not([data-theme]) #aiGoalModal .modal-title {
    color: #f9fafb !important;
  }
  html:not([data-theme]) #aiGoalModal .ai-tabs {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
  }
  html:not([data-theme]) #aiGoalModal .ai-tab-btn {
    color: #9ca3af !important;
  }
  html:not([data-theme]) #aiGoalModal .ai-tab-btn.active {
    color: #3b82f6 !important;
    border-color: #3b82f6 !important;
  }
  html:not([data-theme]) #aiGoalModal .info-box {
    background: rgba(59, 130, 246, 0.1) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
  }
  html:not([data-theme]) #aiGoalModal .info-box h4 {
    color: #60a5fa !important;
  }
  html:not([data-theme]) #aiGoalModal .info-box ol,
  html:not([data-theme]) #aiGoalModal .info-box li {
    color: #93c5fd !important;
  }
  html:not([data-theme]) #aiGoalModal .form-label,
  html:not([data-theme]) #aiGoalModal label {
    color: #d1d5db !important;
  }
  html:not([data-theme]) #aiGoalModal .form-input,
  html:not([data-theme]) #aiGoalModal .form-select,
  html:not([data-theme]) #aiGoalModal .form-textarea,
  html:not([data-theme]) #aiGoalModal input[type="text"],
  html:not([data-theme]) #aiGoalModal input[type="date"],
  html:not([data-theme]) #aiGoalModal select,
  html:not([data-theme]) #aiGoalModal textarea {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #f9fafb !important;
  }
  html:not([data-theme]) #aiGoalModal input::placeholder,
  html:not([data-theme]) #aiGoalModal textarea::placeholder {
    color: #6b7280 !important;
  }
  html:not([data-theme]) #aiGoalModal .generated-prompt-area {
    background: rgba(255, 255, 255, 0.05) !important;
  }
  html:not([data-theme]) #aiGoalModal #ai-generated-prompt {
    background: rgba(0, 0, 0, 0.2) !important;
    color: #d1d5db !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
  }
  html:not([data-theme]) #aiGoalModal .modal-footer {
    background: var(--dm-surface, #1f2937) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
  }
  html:not([data-theme]) #aiGoalModal .modal-btn-secondary {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #d1d5db !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
  }
  html:not([data-theme]) #aiGoalModal #ai-preview-area {
    background: rgba(34, 197, 94, 0.1) !important;
    border-color: rgba(34, 197, 94, 0.3) !important;
  }
  html:not([data-theme]) #aiGoalModal #ai-preview-area h4 {
    color: #4ade80 !important;
  }
  html:not([data-theme]) #aiGoalModal #ai-preview-content {
    color: #86efac !important;
  }
  html:not([data-theme]) #aiGoalModal .error-message {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #f87171 !important;
  }
  html:not([data-theme]) #aiGoalModal input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.5) !important;
  }
}


/* AI 목표 모달 - 계획 미리보기 내부 일정 목록 다크 모드 */
html[data-theme="dark"] #aiGoalModal #ai-preview-area .preview-list,
html[data-theme="dark"] #aiGoalModal #ai-preview-area ul,
html[data-theme="dark"] #aiGoalModal #ai-preview-area ol,
html[data-theme="dark"] #aiGoalModal #ai-preview-area div[style*="background: white"],
html[data-theme="dark"] #aiGoalModal #ai-preview-area div[style*="background: #fff"],
html[data-theme="dark"] #aiGoalModal #ai-preview-area div[style*="background:#fff"],
html[data-theme="dark"] #aiGoalModal .preview-list {
  background: rgba(0, 0, 0, 0.2) !important;
  border-color: rgba(34, 197, 94, 0.2) !important;
}
html[data-theme="dark"] #aiGoalModal #ai-preview-content {
  background: transparent !important;
}
html[data-theme="dark"] #aiGoalModal #ai-preview-content > div {
  background: rgba(0, 0, 0, 0.2) !important;
  border-color: rgba(34, 197, 94, 0.2) !important;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) #aiGoalModal #ai-preview-area .preview-list,
  html:not([data-theme]) #aiGoalModal #ai-preview-area ul,
  html:not([data-theme]) #aiGoalModal #ai-preview-area ol,
  html:not([data-theme]) #aiGoalModal #ai-preview-area div[style*="background: white"],
  html:not([data-theme]) #aiGoalModal #ai-preview-area div[style*="background: #fff"],
  html:not([data-theme]) #aiGoalModal .preview-list {
    background: rgba(0, 0, 0, 0.2) !important;
    border-color: rgba(34, 197, 94, 0.2) !important;
  }
  html:not([data-theme]) #aiGoalModal #ai-preview-content {
    background: transparent !important;
  }
  html:not([data-theme]) #aiGoalModal #ai-preview-content > div {
    background: rgba(0, 0, 0, 0.2) !important;
    border-color: rgba(34, 197, 94, 0.2) !important;
  }
}


/* AI 모달 preview-list 다크 모드 스타일 */
#aiGoalModal .preview-list {
  background: white;
  border: 1px solid #bbf7d0;
}
html[data-theme="dark"] #aiGoalModal .preview-list {
  background: rgba(0, 0, 0, 0.3) !important;
  border: 1px solid rgba(34, 197, 94, 0.2) !important;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) #aiGoalModal .preview-list {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(34, 197, 94, 0.2) !important;
  }
}


/* AI 목표 모달 - 요일 선택기 한 줄 배치 */
#aiGoalModal .day-selector {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
#aiGoalModal .day-option {
  min-width: 0;
  padding: 8px 4px;
}
#aiGoalModal .day-option span {
  font-size: 13px;
}
@media (max-width: 600px) {
  #aiGoalModal .day-selector {
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
  }
  #aiGoalModal .day-option {
    padding: 6px 2px;
  }
  #aiGoalModal .day-option span {
    font-size: 12px;
  }
}


/* 새 독서 목표 모달 - 도서 검색 다크 모드 */
html[data-theme="dark"] #taskModalGlobal .book-search-container input,
html[data-theme="dark"] #taskModalGlobal #book-search {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #f9fafb !important;
}
html[data-theme="dark"] #taskModalGlobal .book-search-container input::placeholder {
  color: #6b7280 !important;
}
html[data-theme="dark"] #taskModalGlobal .book-search-container .btn-secondary,
html[data-theme="dark"] #taskModalGlobal #book-search-btn {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #60a5fa !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
}
html[data-theme="dark"] #taskModalGlobal .book-search-container .btn-secondary:hover,
html[data-theme="dark"] #taskModalGlobal #book-search-btn:hover {
  background: rgba(59, 130, 246, 0.2) !important;
}
html[data-theme="dark"] #taskModalGlobal #task-name {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #f9fafb !important;
}
html[data-theme="dark"] #taskModalGlobal #task-name[readonly] {
  background: rgba(255, 255, 255, 0.03) !important;
  color: #9ca3af !important;
}
html[data-theme="dark"] #taskModalGlobal .book-search-results {
  background: rgba(30, 41, 59, 0.95) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
html[data-theme="dark"] #taskModalGlobal .book-result-item {
  border-color: rgba(255, 255, 255, 0.1) !important;
}
html[data-theme="dark"] #taskModalGlobal .book-result-item:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}
html[data-theme="dark"] #taskModalGlobal .book-title {
  color: #f9fafb !important;
}
html[data-theme="dark"] #taskModalGlobal .book-author,
html[data-theme="dark"] #taskModalGlobal .book-publisher {
  color: #9ca3af !important;
}
/* 목표 요약 다크 모드 */
html[data-theme="dark"] #taskModalGlobal .task-summary,
html[data-theme="dark"] #taskModalGlobal #task-summary {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #d1d5db !important;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) #taskModalGlobal .book-search-container input,
  html:not([data-theme]) #taskModalGlobal #book-search {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #f9fafb !important;
  }
  html:not([data-theme]) #taskModalGlobal .book-search-container .btn-secondary,
  html:not([data-theme]) #taskModalGlobal #book-search-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #60a5fa !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
  }
  html:not([data-theme]) #taskModalGlobal #task-name {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #f9fafb !important;
  }
  html:not([data-theme]) #taskModalGlobal #task-name[readonly] {
    background: rgba(255, 255, 255, 0.03) !important;
    color: #9ca3af !important;
  }
  html:not([data-theme]) #taskModalGlobal .book-search-results {
    background: rgba(30, 41, 59, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
  }
  html:not([data-theme]) #taskModalGlobal .book-result-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
  }
  html:not([data-theme]) #taskModalGlobal .book-title {
    color: #f9fafb !important;
  }
  html:not([data-theme]) #taskModalGlobal .book-author,
  html:not([data-theme]) #taskModalGlobal .book-publisher {
    color: #9ca3af !important;
  }
  html:not([data-theme]) #taskModalGlobal .task-summary,
  html:not([data-theme]) #taskModalGlobal #task-summary {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #d1d5db !important;
  }
}

/* ==========================================================================
   우리들의 서재 모달 (Library Preview Modal) 다크 모드
   ========================================================================== */

/* 기본 스타일 */
.lib-preview-meta .meta-row {
  color: var(--dm-text-primary, #374151);
}

.lib-preview-meta .meta-row.secondary {
  color: var(--dm-text-secondary, #6b7280);
  font-size: 13px;
}

.lib-preview-desc {
  margin-top: 8px;
  white-space: pre-wrap;
  color: var(--dm-text-primary, #374151);
  line-height: 1.4;
}

.lib-preview-quotes {
  padding: 12px 16px;
  border-top: 1px solid var(--gray-200, #eee);
}

.lib-preview-quotes .quotes-title {
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--dm-text-primary);
}

/* 다크 모드 */
html[data-theme="dark"] #libPreviewModal .lib-preview-meta .meta-row {
  color: #e2e8f0 !important;
}

html[data-theme="dark"] #libPreviewModal .lib-preview-meta .meta-row.secondary {
  color: #9ca3af !important;
}

html[data-theme="dark"] #libPreviewModal .lib-preview-desc {
  color: #e2e8f0 !important;
}

html[data-theme="dark"] #libPreviewModal .lib-preview-quotes {
  border-top-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme="dark"] #libPreviewModal .lib-preview-quotes .quotes-title {
  color: #f3f4f6 !important;
}

html[data-theme="dark"] #libPreviewModal .quote-item {
  color: #d1d5db !important;
}

html[data-theme="dark"] #libPreviewModal .empty {
  color: #9ca3af !important;
}

/* 시스템 다크 모드 */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) #libPreviewModal .lib-preview-meta .meta-row {
    color: #e2e8f0 !important;
  }

  html:not([data-theme="light"]) #libPreviewModal .lib-preview-meta .meta-row.secondary {
    color: #9ca3af !important;
  }

  html:not([data-theme="light"]) #libPreviewModal .lib-preview-desc {
    color: #e2e8f0 !important;
  }

  html:not([data-theme="light"]) #libPreviewModal .lib-preview-quotes {
    border-top-color: rgba(255, 255, 255, 0.1) !important;
  }

  html:not([data-theme="light"]) #libPreviewModal .quotes-title {
    color: #f3f4f6 !important;
  }

  html:not([data-theme="light"]) #libPreviewModal .quote-item,
  html:not([data-theme="light"]) #libPreviewModal .empty {
    color: #d1d5db !important;
  }
}
