/* === 다크모드 강제 무력화 (확장프로그램 포함) === */
*, *::before, *::after { color-scheme: light !important; }
html, body { color-scheme: light !important; filter: none !important; }
@media (prefers-color-scheme: dark) {
  html, body { background: #fafbfc !important; color: #0f172a !important; }
}

html { background: #fafbfc !important; }
body {
  font-family: 'Pretendard Variable', 'Pretendard',
               -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo',
               'Segoe UI', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.01em;
  background: #fafbfc !important;
  color: #0f172a !important;
}

/* form 컨트롤 강제 라이트 */
input, select, textarea, button { color-scheme: light !important; }
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], textarea {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1;
}
select {
  background-color: #ffffff !important;
  color: #0f172a !important;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 1.2em;
  padding-right: 2.5rem;
}
input::placeholder, textarea::placeholder { color: #94a3b8 !important; }
input[type="checkbox"] { accent-color: #4f46e5 !important; }

/* === 미니멀 라이트 (Linear/Notion 스타일) === */
main { background: #fafafa !important; }
aside { background: #ffffff !important; border-color: #ececec !important; }

/* 카드: 순백 + 매우 미세한 그림자만 */
.bg-white { background-color: #ffffff !important; }

/* KPI 카드 — 채도 낮춘 차분한 톤 */
.bg-blue-50 { background-color: #f5f7fb !important; }
.bg-amber-50 { background-color: #faf7f0 !important; }
.bg-emerald-50 { background-color: #f3f8f5 !important; }
.bg-violet-50 { background-color: #f6f5fa !important; }
.bg-red-50 { background-color: #faf5f5 !important; }
.bg-slate-50 { background-color: #f8f8f8 !important; }
.bg-slate-100 { background-color: #f3f3f3 !important; }

/* 보더 톤 통일 */
.border-slate-200 { border-color: #ececec !important; }
.border-slate-100 { border-color: #f3f3f3 !important; }
.border-slate-300 { border-color: #d4d4d4 !important; }

/* 사이드바 active */
.nav-item.active {
  background: #18181b !important;
  color: white !important;
}
.nav-item.active svg { color: white !important; }
.nav-item { font-weight: 500; }

/* 카드 hover 그림자 */
.hover\:shadow-lg:hover {
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.06) !important;
}

/* 배지 */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 9999px;
  font-size: 11px; font-weight: 600;
  letter-spacing: -0.02em;
  background-color: #f3f3f3; color: #525252;
}

/* 채널 선택 버튼 */
.ch-btn { border-color: #e5e7eb; background: white; }
.ch-btn:hover { border-color: #cbd5e1; background: #f8fafc; }
.ch-btn.active { border-color: #18181b !important; background: #f8fafc; box-shadow: 0 0 0 3px rgba(24,24,27,0.05); }

/* 토스트 알림 (화면 중앙) */
#toast-container {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  display: flex; flex-direction: column;
  gap: 8px; align-items: center;
  pointer-events: none;
}
.toast-item {
  background: #18181b; color: white;
  padding: 14px 22px; border-radius: 12px;
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.05);
  font-size: 14px; font-weight: 500;
  max-width: 420px;
  opacity: 0; transform: scale(0.95);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
}
.toast-item.show { opacity: 1; transform: scale(1); }

/* 저장된 검색 칩 */
.saved-search {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid #e5e7eb;
  background: white;
  font-size: 12px; font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}
.saved-search:hover { border-color: #cbd5e1; background: #f8fafc; }
.saved-search.active {
  background: #18181b !important;
  color: white !important;
  border-color: #18181b !important;
}
.saved-search.active .count { color: #94a3b8 !important; }
.saved-search .count { color: #94a3b8; font-size: 10px; }

/* 로고 마크 (브랜드) */
.logo-mark {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #c026d3 100%);
  box-shadow:
    0 8px 16px -4px rgba(79, 70, 229, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset,
    0 1px 0 rgba(255, 255, 255, 0.2) inset;
  letter-spacing: -0.04em;
  transition: transform 0.2s, box-shadow 0.2s;
}
.group:hover .logo-mark {
  transform: translateY(-1px) rotate(-2deg);
  box-shadow:
    0 12px 24px -6px rgba(79, 70, 229, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.15) inset,
    0 1px 0 rgba(255, 255, 255, 0.3) inset;
}

/* 별표 (Watchlist) */
.star-btn {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px;
  color: #cbd5e1;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s;
}
.star-btn:hover { background: #f1f5f9; color: #fbbf24; }
.star-btn.active { color: #f59e0b; }
.star-btn.active::before { content: '★'; }
.star-btn:not(.active)::before { content: '☆'; }

/* 탭 통일 스타일 */
.tab-row { display: flex; gap: 4px; border-bottom: 1px solid #ececec; margin-bottom: -1px; }
.tab-row > button {
  padding: 8px 16px;
  font-size: 13px; font-weight: 500;
  color: #64748b;
  border-bottom: 2px solid transparent;
}
.tab-row > button:hover { color: #334155; }
.tab-row > button.active { color: #0f172a; font-weight: 600; border-bottom-color: #18181b; }

code, pre, .font-mono { font-family: 'JetBrains Mono', 'D2Coding', 'Consolas', monospace; }
.scrollbar-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }

.score-bar { height: 4px; background: #e2e8f0; border-radius: 2px; overflow: hidden; }
.score-bar-fill { height: 100%; background: linear-gradient(90deg, #3b82f6, #8b5cf6); }
.timeline-dot { width: 8px; height: 8px; border-radius: 50%; background: #3b82f6; flex-shrink: 0; }

/* ─── 파일 드롭존 ─── */
.dropzone {
  position: relative;
  transition: background-color .15s, border-color .15s;
}
.dropzone .dz-prompt {
  cursor: pointer;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  background: #f8fafc;
  transition: all .15s;
}
.dropzone .dz-prompt:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}
.dropzone.dz-active .dz-prompt {
  border-color: #6366f1;
  background: #eef2ff;
  transform: scale(1.01);
}
.dropzone.dz-active .dz-prompt .dz-icon {
  animation: dz-bounce .4s ease infinite alternate;
}
@keyframes dz-bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-4px); }
}
.dz-files { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.dz-files:empty { display: none; }

/* 폰트 가중치 */
h1, h2, h3 { letter-spacing: -0.025em; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

/* 숫자 tabular */
table td, .text-2xl, .text-3xl, .text-xl { font-variant-numeric: tabular-nums; }

/* 전환 */
button, .transition { transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1); }
