/* ===== Reset & Base ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Segoe UI", Roboto, sans-serif;
  background: #f6f8fb;
  color: #111827;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select { font-family: inherit; outline: none; }
.hidden { display: none !important; }

/* ===== Layout ===== */
.app { display: flex; min-height: 100vh; }

/* v6.15.39 (P3-9): 모바일 햄버거 + 오버레이 (데스크톱 기본 숨김) */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 65;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #0f172a;
  color: #f1f5f9;
  font-size: 20px;
  line-height: 1;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 55;
}

/* ===== Sidebar ===== */
.sidebar {
  width: 240px;
  background: #0f172a;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px;
  border-bottom: 1px solid #1e293b;
}
.brand-icon { font-size: 20px; }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; color: #f1f5f9; }

.nav-section { padding: 18px 12px 8px; }
.nav-section-title {
  font-size: 11px;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 4px 8px 10px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: #cbd5e1;
  transition: all 0.15s;
  margin-bottom: 2px;
}
.nav-item:hover { background: #1e293b; color: #f1f5f9; }
.nav-item.active {
  background: #2563eb;
  color: #fff;
  font-weight: 500;
}
.nav-icon { font-size: 15px; width: 18px; text-align: center; }
.nav-label { flex: 1; }
.nav-toggle { font-size: 11px; opacity: 0.5; }

/* 사이드바 — expandable group */
.nav-group { margin-bottom: 4px; }
.nav-parent {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: #cbd5e1;
  transition: all 0.15s;
}
.nav-parent:hover { background: #1e293b; color: #f1f5f9; }
.nav-parent.active { background: #2563eb; color: #fff; font-weight: 500; }

.nav-children {
  display: flex;
  flex-direction: column;
  padding: 2px 0 4px 28px;
  gap: 1px;
}
.nav-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  color: #94a3b8;
  transition: all 0.15s;
}
.nav-sub:hover { background: #1e293b; color: #cbd5e1; }
.nav-sub.active { color: #93c5fd; font-weight: 600; }
.nav-sub-bullet { color: #475569; }
.nav-sub.active .nav-sub-bullet { color: #60a5fa; }

.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  font-size: 11px;
  color: #475569;
  border-top: 1px solid #1e293b;
}

/* ===== Main ===== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ===== Topbar ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.topbar h1 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.view-hint { font-size: 12px; color: #6b7280; }
.topbar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #6b7280;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

/* ===== Content ===== */
.content { padding: 28px 32px; flex: 1; }

/* ===== Stat Row ===== */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}
.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}
.stat-hint {
  font-size: 11px;
  color: #9ca3af;
}
.stat-card.accent .stat-value { color: #2563eb; }
.stat-card.success .stat-value { color: #16a34a; }
.stat-card.highlight {
  background: linear-gradient(135deg, #fff7ed 0%, #fffbeb 100%);
  border-color: #fde68a;
}
.stat-card.highlight .stat-value { color: #d97706; }

/* ===== 다중 선택 액션 바 ===== */
.select-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.select-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
}
.link-btn {
  background: none;
  border: none;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
  font-size: 13px;
  opacity: 0.9;
  padding: 0;
}
.link-btn:hover { opacity: 1; }
.select-bar .btn-primary {
  background: #fff;
  color: #2563eb;
  font-weight: 700;
  border: none;
  padding: 8px 16px;
}
.select-bar .btn-primary:hover { background: #f1f5f9; }

/* ===== 카드 체크박스 ===== */
.news-card {
  position: relative;
}
.news-card.is-selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
/* v2.7.7: 체크박스를 card-top 안 인라인으로 — 중요도·날짜와 수평 정렬 */
.card-checkbox {
  position: static;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 1;
  transition: border-color 0.15s, background 0.15s;
  border: 1.5px solid #cbd5e1;
  flex-shrink: 0;
  margin: 0;
}
.card-checkbox:hover { border-color: #2563eb; }
.news-card.is-selected .card-checkbox {
  border-color: #2563eb;
  background: #eff6ff;
}
.card-top-left {
  display: flex;
  gap: 8px;
  align-items: center;
}
.card-top-right {
  display: flex;
  gap: 6px;
  align-items: center;
}
.card-check {
  margin: 0;
  cursor: pointer;
}
/* v2.7.7: 체크박스가 card-top 내부 인라인이라 별도 좌측 패딩 불필요 */
.news-card .card-top { padding-left: 0; }

/* 검색바 액션 버튼 */
.search-action {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.search-action:hover { background: #1d4ed8; }
.btn-primary {
  background: #2563eb;
  color: #fff;
  border: none;
}
.btn-primary:hover { background: #1d4ed8; }

/* ===== 분석 모달 ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal.hidden { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
}
.modal-panel {
  position: relative;
  background: #fff;
  border-radius: 14px;
  width: 90vw;
  max-width: 760px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.3);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #e5e7eb;
}
.modal-head h2 { font-size: 17px; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: #6b7280;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 6px;
}
.modal-close:hover { background: #f3f4f6; color: #0f172a; }
.modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 0 0 14px 14px;
}

.analyze-preview {
  background: #f8fafc;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13px;
}
.analyze-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #4b5563;
  font-weight: 500;
}
.analyze-preview-head .link-btn {
  color: #2563eb;
  text-decoration: none;
}
.analyze-preview-list {
  list-style: decimal inside;
  margin-top: 8px;
  max-height: 160px;
  overflow-y: auto;
  font-size: 12px;
  color: #4b5563;
  line-height: 1.6;
  padding-right: 6px;
}
.analyze-preview-list .rel-source { color: #9ca3af; font-size: 11px; }

.analyze-row {
  margin-bottom: 16px;
}
.analyze-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #9ca3af;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.model-hint {
  display: block;
  margin-top: 6px;
  color: #6b7280;
  font-size: 11.5px;
}
.backend-tabs {
  display: flex;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.backend-tab {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  border-radius: 6px;
  transition: all 0.15s;
  border: none;
  background: transparent;
  cursor: pointer;
}
.backend-tab.active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.prompt-preset {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
  margin-bottom: 8px;
}
.prompt-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  line-height: 1.5;
}
.prompt-input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }

.analyze-keys {
  background: #fafaf9;
  padding: 10px 14px;
  border-radius: 7px;
  font-size: 13px;
}
.analyze-keys summary {
  cursor: pointer;
  font-weight: 500;
  color: #4b5563;
  user-select: none;
}
.analyze-key-input { margin-top: 10px; }
.analyze-key-input input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  font-size: 13px;
  font-family: monospace;
}
.analyze-key-input small {
  display: block;
  color: #9ca3af;
  font-size: 11px;
  margin-top: 5px;
}

.analyze-result-wrap {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
}
.analyze-result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.analyze-result-label {
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.analyze-result {
  background: #f8fafc;
  padding: 16px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.7;
  color: #1f2937;
  /* v2.8.6: 본문 weight 명시 (mark 외에는 절대 굵게 X) */
  font-weight: 400;
}
.analyze-result p, .analyze-result li, .analyze-result span { font-weight: 400; }
/* v2.8.4: 헤더 폰트 본문과 동일 + 볼드만 */
.analyze-result h1,
.analyze-result h2,
.analyze-result h3 {
  font-size: inherit;
  font-weight: 700;
  margin: 12px 0 4px;
  color: #0f172a;
  line-height: inherit;
  display: block;
}
.analyze-result p { margin: 8px 0; }
.analyze-result ul { padding-left: 22px; margin: 6px 0; }
.analyze-result li { margin: 4px 0; }
.analyze-result code {
  background: #e5e7eb;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}
.analyze-result pre {
  background: #0f172a;
  color: #f1f5f9;
  padding: 12px;
  border-radius: 6px;
  font-size: 12px;
  overflow-x: auto;
}
/* v2.8.4: mark가 아닌 강조는 normal weight — 음영(mark)만 볼드 */
.analyze-result strong, .analyze-result b {
  font-weight: normal;
  color: inherit;
}
.analyze-loading {
  text-align: center;
  color: #6b7280;
  padding: 20px;
}
/* v2.7.2: 스트리밍 — 로딩 dot 애니메이션 + 타이핑 커서 */
.analyze-loading .dots::after {
  content: "";
  display: inline-block;
  animation: dots 1.4s steps(4, end) infinite;
}
@keyframes dots {
  0%   { content: ""; }
  25%  { content: "."; }
  50%  { content: ".."; }
  75%  { content: "..."; }
  100% { content: ""; }
}
.analyze-stream {
  white-space: normal;
  word-break: break-word;
}
.stream-cursor {
  display: inline-block;
  margin-left: 1px;
  color: #2563eb;
  font-weight: 700;
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink {
  to { visibility: hidden; }
}
/* 분석 결과 안의 ## 🧭 분석 계획 / 📊 분석 결과 헤더 살짝 강조 */
.analyze-result h2 {
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 4px;
  margin-top: 14px;
}
.analyze-error {
  background: #fef2f2;
  color: #b91c1c;
  padding: 12px 14px;
  border-radius: 7px;
  border-left: 3px solid #dc2626;
}
.analyze-error strong { display: block; margin-bottom: 4px; }
.analyze-error p { margin: 4px 0; font-size: 13px; }

.analyze-meta {
  margin-top: 8px;
  font-size: 11px;
  color: #9ca3af;
  text-align: right;
}

/* ===== Filter Label & Category Bar ===== */
.filter-label {
  font-size: 11px;
  font-weight: 700;
  color: #9ca3af;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.category-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 8px;
  background: #fff;
  color: #4b5563;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid #e5e7eb;
  transition: all 0.15s;
}
.cat-chip:hover { background: #f3f4f6; }
.cat-chip.active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}
.cat-chip .cat-count {
  display: inline-block;
  font-size: 11px;
  background: rgba(107, 114, 128, 0.15);
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
}
.cat-chip.active .cat-count {
  background: rgba(255, 255, 255, 0.2);
}

/* ===== Controls Row ===== */
.controls-row {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.search-wrap {
  flex: 1;
  min-width: 280px;
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  padding: 9px 13px;
}
.search-wrap:focus-within { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.search-icon { color: #9ca3af; margin-right: 8px; }
#search-input {
  flex: 1;
  border: none;
  font-size: 14px;
  background: transparent;
}
.control-group { display: flex; align-items: center; gap: 8px; }
.control-label {
  font-size: 11px;
  font-weight: 700;
  color: #9ca3af;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.btn-group { display: flex; background: #f3f4f6; border-radius: 8px; padding: 2px; }
.seg-btn {
  padding: 6px 12px;
  font-size: 13px;
  color: #6b7280;
  border-radius: 6px;
  transition: all 0.15s;
}
.seg-btn.active {
  background: #fff;
  color: #0f172a;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
/* v2.7.3: 정렬도 기간/언어와 동일 스타일 적용 */
#date-filter, #lang-filter, #sort-filter {
  padding: 7px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
  color: #0f172a;
}
/* v6.15.26 (2026-05-29): 특정 일자 input — 기간 select 바로 오른편 */
.specific-date-input {
  padding: 7px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
  color: #0f172a;
  font-family: inherit;
  cursor: pointer;
}
.specific-date-input:hover {
  border-color: #2563eb;
}
.specific-date-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ===== News Grid ===== */
.news-grid {
  display: grid;
  /* v6.15.39 (P3-9): min(360px,100%)로 좁은 화면(<360px)에서 카드 가로 넘침 방지 */
  grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr));
  gap: 14px;
}

/* v6.15.37 (P3-8): 뉴스 피드 점진 렌더 '더 보기' 버튼 */
.load-more-wrap {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
}
.load-more-btn {
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 600;
  color: #2563eb;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.load-more-btn:hover {
  background: #f1f5f9;
  border-color: #2563eb;
}

/* v2.7.5: AI 분석 결과 history page */
.analyses-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.analysis-entry {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 20px;
}
.analysis-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.analysis-time {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 4px;
}
.analysis-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: #6b7280;
}
.analysis-meta-row > span {
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
}
.analysis-preset { color: #2563eb; background: #eff6ff !important; }
.analysis-actions { display: flex; gap: 6px; align-items: center; }
.analysis-del { color: #dc2626; }
.analysis-detail, .analysis-prompt-detail {
  font-size: 12px;
  color: #6b7280;
  margin: 8px 0;
}
.analysis-items {
  margin: 6px 0;
  padding-left: 22px;
}
.analysis-items li { margin: 3px 0; font-size: 12px; }
.analysis-prompt-detail pre {
  background: #f8fafc;
  padding: 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}
.analysis-result-body {
  background: #f8fafc;
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.7;
  color: #1f2937;
  margin-top: 10px;
}
.analysis-result-body h2 {
  font-size: 15px;
  margin-top: 12px;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 4px;
}
.analysis-result-body.hidden { display: none; }

/* v2.7.4: 저장한 항목 view 레이아웃 — 섹션 헤더와 nested grid가 풀폭 차지 */
.news-grid > .saved-section-head,
.news-grid > .saved-list,
.news-grid > .saved-news-grid {
  grid-column: 1 / -1;
}
.saved-section-head {
  margin: 8px 0 14px;
  font-size: 14px;
  color: #6b7280;
  font-weight: 600;
}
/* v2.7.7: 저장한 항목 시사점/뉴스 탭 */
.news-grid > .saved-tabs { grid-column: 1 / -1; }
.saved-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 18px;
}

/* v6.11: 북마크 toolbar — 다운로드/가져오기 */
.news-grid > .saved-toolbar { grid-column: 1 / -1; }
.saved-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0 12px;
  flex-wrap: wrap;
}
.saved-toolbar-info {
  font-size: 13px;
  color: #6b7280;
}
.saved-toolbar-spacer { flex: 1; }
.saved-toolbar-btn {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.4;
  transition: background 0.15s, border-color 0.15s;
}
.saved-toolbar-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}
.saved-toolbar-btn:active {
  background: #e5e7eb;
}
/* v6.12: disabled 상태 (빈 북마크 시 다운로드 비활성화) */
.saved-toolbar-btn:disabled,
.saved-toolbar-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  background: #f9fafb;
  border-color: #e5e7eb;
}
.saved-toolbar-btn:disabled:hover,
.saved-toolbar-btn[disabled]:hover {
  background: #f9fafb;
  border-color: #e5e7eb;
}
.saved-tab {
  background: transparent;
  border: none;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s, border-color 0.15s;
}
.saved-tab:hover { color: #0f172a; }
.saved-tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  font-weight: 600;
}
.saved-tab-count {
  background: #f1f5f9;
  color: #6b7280;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}
.saved-tab.active .saved-tab-count {
  background: #eff6ff;
  color: #2563eb;
}
.saved-section-head + .saved-section-head,
.saved-list + .saved-section-head {
  margin-top: 28px;
}
.saved-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.saved-news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}
.saved-at-label {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #f3f4f6;
}
.news-card .saved-at-label {
  margin: 6px 0 0;
  padding: 4px 0 0;
  border-top: 1px dashed #f3f4f6;
}

.news-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}
.news-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.02em;
}
.score-badge.high { background: #fef2f2; color: #b91c1c; }
.score-badge.mid { background: #fef3c7; color: #92400e; }
.score-badge.low { background: #f3f4f6; color: #4b5563; }

.related-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.date-text { color: #9ca3af; font-size: 11px; }

.card-cats { display: flex; gap: 4px; flex-wrap: wrap; }
.card-category {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
}
.cat-ai-industry { background: #eff6ff; color: #1d4ed8; }
.cat-legaltech { background: #fef3c7; color: #a16207; }
.cat-papers { background: #faf5ff; color: #7c3aed; }
.cat-domestic { background: #fff7ed; color: #c2410c; }
.cat-product { background: #ecfdf5; color: #047857; }
.cat-funding { background: #fdf2f8; color: #be185d; }
.cat-adoption { background: #f0fdfa; color: #0f766e; }
.cat-policy { background: #fef2f2; color: #b91c1c; }
.cat-general { background: #f3f4f6; color: #4b5563; }
/* v6.15.17: 신규 카테고리 색상 — models/coding/infra */
.cat-models { background: #ecfeff; color: #0e7490; }         /* 청록 — 모델 비즈니스 */
.cat-coding { background: #f5f3ff; color: #6d28d9; }         /* 보라 — 개발자 도구 */
.cat-infra { background: #fffbeb; color: #b45309; }          /* 황색 — 인프라 */
.cat-governance { background: #f0f9ff; color: #075985; }     /* (기존 누락 보강) */
.cat-gov_policy { background: #fdf4ff; color: #86198f; }     /* (기존 누락 보강) */
.cat-market { background: #f7fee7; color: #4d7c0f; }         /* (기존 누락 보강) */

.card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: #0f172a;
}
.card-title a { color: inherit; }
.card-title a:hover { color: #2563eb; text-decoration: underline; }

.card-summary {
  font-size: 15px;  /* v6.12: 13→15 (+2px) — 뉴스 카드 본문 가독성 강화 */
  color: #4b5563;
  line-height: 1.65;
}
.card-summary.has-ko {
  color: #1f2937;
}
.card-summary.is-en {
  color: #6b7280;
  font-style: italic;
}

/* 원문 요약 토글 (영문 → 한국어 요약이 있을 때 영문 원문 펼침) */
.card-original {
  margin-top: 6px;
  font-size: 11px;
  color: #9ca3af;
  cursor: pointer;
}
.card-original summary {
  display: inline-block;
  user-select: none;
  outline: none;
}
.card-original summary:hover { color: #4b5563; }
.card-original-text {
  margin-top: 6px;
  padding: 8px 10px;
  background: #f9fafb;
  border-radius: 6px;
  color: #4b5563;
  font-size: 12px;
  font-style: italic;
  line-height: 1.55;
}

/* NEW 배지 — 오늘 첫 수집된 항목 */
.new-badge {
  display: inline-block;
  padding: 3px 8px;
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  color: #fff;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
  animation: new-pulse 2.5s ease-in-out infinite;
}
@keyframes new-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* 언어 배지 */
.lang-badge {
  display: inline-block;
  padding: 1px 6px;
  background: #f3f4f6;
  color: #6b7280;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.card-insight {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-left: 3px solid #2563eb;
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  font-size: 14.5px;  /* v6.12: 12.5→14.5 (+2px) — 뉴스 카드 시사점 가독성 강화 */
  color: #334155;
  line-height: 1.65;
}
.card-insight .insight-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #2563eb;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.related-detail {
  display: none;
  margin-top: 8px;
  padding: 10px;
  background: #f9fafb;
  border-radius: 7px;
  font-size: 12px;
}
.related-detail.open { display: block; }
.related-detail .rel-item {
  padding: 4px 0;
  color: #4b5563;
  display: flex;
  gap: 6px;
  align-items: baseline;
}
.related-detail .rel-source {
  color: #6b7280;
  font-size: 11px;
  min-width: 80px;
}
.related-detail a { color: #2563eb; }
.related-detail a:hover { text-decoration: underline; }

.card-bottom {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  justify-content: flex-start;  /* v2.7.3: 좌측 정렬, 카드 액션은 우측 자동 push */
  align-items: center;
  gap: 8px;
}
/* v2.7.3: card-actions는 우측 끝으로 push */
.card-bottom .card-actions {
  margin-left: auto;
}
.card-source {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.card-source-icon {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: #cbd5e1;
  display: inline-block;
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  color: #fff;
}
.card-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: all 0.15s;
  font-size: 14px;
}
.icon-btn:hover { background: #f3f4f6; color: #0f172a; }
/* v6.12: 공유 버튼 (button 태그도 .icon-btn 호환되도록 기본 button reset) */
button.icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font: inherit;
}
button.icon-btn.card-share { font-size: 14px; line-height: 1; }
/* 공유 버튼 클릭 피드백 — 1.5초 동안 표시 */
.icon-btn.is-share-ok {
  background: #ecfdf5 !important;
  color: #16a34a !important;
}
.icon-btn.is-share-error {
  background: #fef2f2 !important;
  color: #dc2626 !important;
}

/* v2.7.3: ai-badge 제거 — 모든 카드에 시사점이 들어가므로 더 이상 차별 표시 불필요 */
.ai-badge {
  display: none !important;
  position: absolute;
  top: 0;
  right: 18px;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 0 0 6px 6px;
  letter-spacing: 0.04em;
}

/* ===== Strategy View ===== */
.strategy-view { width: 100%; }

/* v6.12: 시사점 trend 카드 목록 — 큰 화면 2열, 노트북 1열 */
#strategy-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
/* 1280px 이상 (외부 모니터·데스크탑) → 2열 */
@media (min-width: 1280px) {
  #strategy-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* 1700px 이상 (4K·울트라와이드)에서는 카드 가로폭이 너무 커지므로 max-width로 보호 */
@media (min-width: 1700px) {
  #strategy-cards { max-width: 1600px; }
}

.strategy-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 26px 28px;
  margin-bottom: 0;  /* v6.12: grid gap이 대신 처리. margin 제거 */
}
/* v2.7: TAG/TITLE은 카드 상단 풀폭, BODY/ACTION만 좌우 2단 — BODY 시작 행과 ACTION 시작 행 정렬 */
.strategy-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}
.strategy-card-head > div {
  flex: 1;
  min-width: 0;
}
/* v3.0: 시사점 카드 우측 상단 — 즐겨찾기 + AI 분석 체크박스 (v3.2에서 footer로 이동, deprecated) */
.strategy-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.trend-check {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #2563eb;
  margin: 0;
}
/* v3.2: 좌측 하단 footer — 체크박스 → 즐겨찾기 → 근거 순서 */
.strategy-card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #f3f4f6;
}
.strategy-card-footer .bookmark-btn {
  width: 32px;
  height: 32px;
  font-size: 16px;
}
.strategy-card-footer .strategy-citations {
  margin: 0;
  margin-left: auto;  /* 우측에 별도 정렬할까 했지만 사용자 요청은 좌측 정렬 */
  margin-left: 4px;  /* 좌측 정렬 유지 */
}
.strategy-card.is-selected {
  border-color: #2563eb;
  background: #eff6ff;
}
/* AI 분석 모달 미리보기 — kind 배지 */
.rel-kind {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 4px;
}
.rel-kind.kind-trend {
  background: #dbeafe;
  color: #1d4ed8;
}
.rel-kind.kind-citation {
  background: #f1f5f9;
  color: #475569;
}
.strategy-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;  /* 좌우 영역 모두 위에서 시작 (BODY 첫 줄과 ACTION 첫 줄 align) */
}
@media (max-width: 900px) {
  .strategy-card-grid { grid-template-columns: 1fr; gap: 14px; }
}
/* v6.12: 카드 2열일 때도 카드 내부 body+action 2단 그대로 유지 (사용자 정책) */
.strategy-body {
  min-width: 0;
  margin: 0;
}
.strategy-card .strat-tag {
  /* v2.7: 트렌드 태그 더 두드러지게. title(19px)보다 약간 작은 16px */
  font-size: 16px;
  letter-spacing: 0.01em;
  color: #2563eb;
  font-weight: 700;
  margin-bottom: 12px;
  text-transform: none;
}
.strategy-card h3 {
  font-size: 21px;  /* v6.12: 20→21 */
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
  line-height: 1.4;  /* v6.12: 1.35→1.4 — 더 여유 있게 */
}
.strategy-card p {
  font-size: 15.5px;  /* v6.12: 14→15.5 — 본문 가독성 강화 */
  color: #4b5563;
  line-height: 1.7;   /* v6.12: 1.65→1.7 — 더 여유 있게 */
  margin-bottom: 0;
}
.strategy-action {
  background: #0f172a;
  color: #f1f5f9;
  padding: 18px 22px;  /* v6.12: 16/20→18/22 */
  border-radius: 9px;
  font-size: 14px;  /* v6.12: 13→14 */
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.strategy-action .action-label {
  display: block;
  color: #93c5fd;
  font-size: 11px;  /* v6.12: 10→11 */
  font-weight: 700;
  letter-spacing: 0.06em;
}
.strategy-action .action-body {
  font-size: 15px;  /* v6.12: 13.5→15 */
  line-height: 1.7;
  white-space: pre-line;
}

/* v2.7.1: 핵심 키워드/문구 하이라이트 — 투명한 형광색 (옅은 노랑) + Bold */
mark {
  background: linear-gradient(180deg, transparent 55%, rgba(254, 240, 138, 0.7) 55%);
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
  font-weight: 700;  /* Bold */
}
/* ACTION (어두운 배경)에서는 형광 청록색으로 — 가독성 보장 */
.strategy-action mark {
  background: linear-gradient(180deg, transparent 55%, rgba(110, 231, 183, 0.5) 55%);
  color: #ecfdf5;
  font-weight: 700;
}

/* v2.7: 북마크 버튼 (시사점 카드 + 뉴스 카드 공용) */
.bookmark-btn {
  background: transparent;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 18px;
  cursor: pointer;
  color: #9ca3af;
  flex-shrink: 0;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.bookmark-btn:hover {
  border-color: #f59e0b;
  color: #f59e0b;
}
.bookmark-btn.is-saved {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #f59e0b;
}
.bookmark-btn.is-saved:hover {
  background: #fde68a;
}
/* v2.7.3: 뉴스 카드 북마크 — 좌하단 card-bottom 안의 첫 요소로 인라인 배치 */
.card-bookmark {
  position: static;  /* 더 이상 absolute 아님 */
  width: 26px;
  height: 26px;
  font-size: 14px;
  border-radius: 6px;
  flex-shrink: 0;
}
.news-card { position: relative; }

/* 저장한 항목 빈 상태 */
.saved-empty {
  background: #fff;
  border: 1px dashed #d1d5db;
  border-radius: 12px;
  padding: 60px 24px;
  text-align: center;
  color: #6b7280;
}

/* Strategy controls (Daily/Weekly/Monthly + 셀렉트) */
.strategy-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  flex-wrap: wrap;
}

/* v6.15-D + v6.15.6: 기간 박스 row 바로 밑 inline 종합 요약
   v6.15.6 수정 — 기존 flex row 구조가 label/text/addons를 가로 분배하면서
   본문이 좁은 컬럼으로 압축되는 문제. 단락 흐름(block flow)으로 재설계. */
.strategy-summary-inline {
  flex-basis: 100%;       /* strategy-controls flex-wrap의 다음 줄로 떨어짐 */
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid #f3f4f6;
  font-size: 14px;
  line-height: 1.7;
  color: #374151;
}
.strategy-summary-inline.hidden { display: none; }
/* 본문 단락 — 가로 풀폭, 자연 줄바꿈 */
.strategy-summary-main {
  margin: 0;
}
/* v6.15.9: backend summary 누락 시 cards로 합성된 fallback (옅은 회색) */
.strategy-summary-main.strategy-summary-fallback {
  color: #6b7280;
}
.strategy-summary-main.strategy-summary-fallback strong:not(.strategy-summary-label) {
  color: #374151;
}
/* 라벨을 본문 inline에 흡수 — 단락 첫 단어처럼 흐름에 포함 */
.strategy-summary-label {
  font-weight: 700;
  color: #2563eb;
  margin-right: 6px;
  white-space: nowrap;  /* "📌 종합" 자체는 줄 끊김 방지 */
}
.strategy-summary-main strong { font-weight: 700; }
.strategy-summary-main mark {
  background: linear-gradient(180deg, transparent 55%, rgba(254, 240, 138, 0.6) 55%);
  font-weight: 700;
  color: inherit;
}
/* 증분 누적 summary addon (오후/저녁 빌드에서 추가된 한 줄 메모) — 본문 아래 별도 영역 */
.strategy-summary-addons {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #f3f4f6;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.strategy-summary-addon {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.6;
}
.strategy-period-tabs {
  display: flex;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.period-tab {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  border-radius: 6px;
  transition: all 0.15s;
}
.period-tab.active {
  background: #fff;
  color: #2563eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
#strategy-period-select,
#papers-period-select {
  padding: 7px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
  color: #0f172a;
  font-weight: 500;
}
/* v2.8.5: 논문 흐름 페이지 — 탭과 dropdown 사이에 paper count 인라인 표시 */
/* v3.2: 정중앙에서 탭 바로 오른쪽으로 이동 (flex: 1 + text-align: center 제거) */
.papers-meta-inline {
  font-size: 13px;
  color: #4b5563;
  margin-right: auto;  /* 좌측에 붙고 우측의 select는 우측 끝으로 밀려남 */
  padding-left: 4px;
}
.papers-meta-inline strong {
  color: #0f172a;
  font-weight: 700;
}
.papers-meta-empty { color: #9ca3af; }

/* 7일 추이 차트 */
.chart-wrap {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
}
.chart-wrap h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
}
.chart-canvas-wrap {
  position: relative;
  height: 380px;
  width: 100%;
}
.trend-legend {
  margin-top: 12px;
  font-size: 11px;
}
.trend-note {
  color: #6b7280;
  background: #f9fafb;
  padding: 8px 12px;
  border-radius: 6px;
}

/* Strategy citations */
.strategy-citations {
  margin-top: 14px;
  font-size: 12px;
  color: #6b7280;
}
.strategy-citations summary {
  cursor: pointer;
  user-select: none;
  padding: 6px 10px;
  background: #f3f4f6;
  border-radius: 6px;
  display: inline-block;
  font-weight: 500;
  color: #4b5563;
  outline: none;
}
.strategy-citations summary:hover {
  background: #e5e7eb;
  color: #0f172a;
}
.strategy-citations .citation-list {
  margin-top: 10px;
  padding-left: 20px;
  list-style: decimal;
  line-height: 1.65;
}
.strategy-citations .citation-list li { margin-bottom: 6px; }
.strategy-citations .citation-list a {
  color: #2563eb;
  font-weight: 500;
}
.strategy-citations .citation-list a:hover { text-decoration: underline; }
.strategy-citations .citation-meta {
  color: #9ca3af;
  font-size: 11px;
  margin-left: 4px;
}
/* v4.9: 본문 (N번)과 매칭되는 citation 번호 prefix */
.strategy-citations .citation-num {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  color: #4f46e5;
  background: #eef2ff;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 4px;
}

/* ===== 논문 흐름 뷰 ===== */
.papers-view { width: 100%; }
.papers-meta {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 16px;
}
.papers-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #4b5563;
}
.papers-meta-time { color: #9ca3af; font-size: 11px; }

.papers-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 16px;
}
.papers-section h3 {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}
.papers-narrative {
  font-size: 15px;  /* v6.12: 13.5→15 — 본문 가독성 강화 */
  line-height: 1.8;  /* v6.12: 1.75→1.8 */
  color: #1f2937;
  /* v2.8.6: 본문 weight 명시 (mark 외에는 절대 굵게 X) */
  font-weight: 400;
}
.papers-narrative p,
.papers-narrative li,
.papers-narrative span {
  font-weight: 400;
}
/* v2.8.4: 헤더 폰트를 본문과 동일하게 + 볼드만. mark가 아닌 강조는 normal weight */
.papers-narrative h1,
.papers-narrative h2,
.papers-narrative h3 {
  font-size: inherit;
  font-weight: 700;
  margin: 12px 0 4px;
  line-height: inherit;
  color: #0f172a;
  display: block;
}
.papers-narrative ul { padding-left: 22px; margin: 6px 0; }
.papers-narrative p { margin: 6px 0; }
/* mark 외 볼드 처리 제거 — 음영 처리된 부분(mark)만 강조 */
.papers-narrative strong, .papers-narrative b {
  font-weight: normal;
  color: inherit;
}
/* v3.2: 헤더(`# 한 줄 요약` 등) → 본문 사이즈 + bold, # 자체는 표시 안 함 */
.papers-narrative strong.inline-h,
.strategy-body strong.inline-h,
.action-body strong.inline-h,
.analyze-result strong.inline-h,
.analysis-result-body strong.inline-h {
  font-weight: 700;
  font-size: inherit;
  color: #0f172a;
  display: inline;
}
/* 시사점 카드 body/action 도 음영(mark) 외 strong은 normal */
.strategy-body strong,
.strategy-body b,
.action-body strong,
.action-body b {
  font-weight: normal;
  color: inherit;
}
.strategy-body strong.inline-h,
.action-body strong.inline-h {
  font-weight: 700;  /* inline-h만 bold 복원 */
}

.papers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 900px) { .papers-grid { grid-template-columns: 1fr; } }
.papers-grid .papers-section { margin-bottom: 0; }

/* v6.12: 논문 페이지 — '🔥 최근 흐름' + '💡 실무 시사점' 2열 (큰 화면) */
.papers-trend-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (min-width: 1280px) {
  .papers-trend-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
}
.papers-trend-grid .papers-section { margin-bottom: 0; }

.topic-item {
  padding: 10px 12px;
  background: #f9fafb;
  border-radius: 7px;
  margin-bottom: 8px;
}
.topic-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.topic-name {
  font-weight: 600;
  color: #0f172a;
  font-size: 13px;
}
.topic-count {
  background: #e0e7ff;
  color: #4338ca;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.topic-desc {
  color: #4b5563;
  font-size: 12.5px;
  line-height: 1.5;
}

/* 관련 논문 드롭다운 (부상 주제 / 핵심 기법 내부) */
.topic-papers {
  margin-top: 8px;
  font-size: 12px;
}
.topic-papers summary {
  cursor: pointer;
  user-select: none;
  display: inline-block;
  padding: 4px 10px;
  background: #eef2ff;
  color: #4338ca;
  border-radius: 4px;
  font-weight: 500;
  font-size: 11.5px;
  list-style: none;
}
.topic-papers summary::-webkit-details-marker { display: none; }
.topic-papers summary:hover { background: #e0e7ff; }
.topic-papers .topic-paper-list {
  margin-top: 8px;
  padding-left: 18px;
  color: #4b5563;
  line-height: 1.6;
}
.topic-papers .topic-paper-list li { margin-bottom: 5px; }
.topic-papers .topic-paper-list a {
  color: #2563eb;
  font-weight: 500;
}
.topic-papers .topic-paper-list a:hover { text-decoration: underline; }
.topic-papers .topic-paper-meta {
  color: #9ca3af;
  font-size: 11px;
}

.freq-list { display: flex; flex-direction: column; gap: 8px; }
.freq-item {
  display: grid;
  grid-template-columns: 130px 1fr 32px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}
.freq-name {
  color: #1f2937;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.freq-bar {
  height: 10px;
  background: linear-gradient(90deg, #2563eb 0%, #7c3aed 100%);
  border-radius: 4px;
  min-width: 4px;
}
.freq-count {
  text-align: right;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 600;
}

.kw-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  line-height: 1.6;
}
.kw-tag {
  background: #f3f4f6;
  color: #1e40af;
  padding: 3px 10px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.kw-tag em {
  color: #6b7280;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
}

/* v3.4: 음영 박스 제거 → 1) 2) 3) 일반 numbered list, mark만 형광펜 강조 */
.papers-actionable {
  list-style: none;
  padding: 0;
  counter-reset: actionable-counter;
  margin: 8px 0 0;
}
.papers-actionable li {
  counter-increment: actionable-counter;
  padding: 6px 0 6px 28px;
  position: relative;
  background: transparent;
  border: none;
  border-radius: 0;
  margin-bottom: 6px;
  font-size: 15px;  /* v6.12: 13.5→15 */
  color: #1f2937;
  font-weight: 400;
  line-height: 1.8;  /* v6.12: 1.75→1.8 */
}
.papers-actionable li::before {
  content: counter(actionable-counter) ")";
  position: absolute;
  left: 0;
  top: 6px;
  font-weight: 600;
  color: #4b5563;
}
.papers-actionable li strong, .papers-actionable li b {
  font-weight: normal;  /* mark 외 strong은 normal */
}
.papers-actionable li mark {
  font-weight: 700;  /* mark만 bold + 노란 음영 */
}

.papers-list { display: flex; flex-direction: column; gap: 10px; }
.paper-row {
  padding: 12px 14px;
  background: #f9fafb;
  border-radius: 8px;
}
.paper-row-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.paper-row-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  text-decoration: none;
  line-height: 1.5;
  margin-bottom: 4px;
}
.paper-row-title:hover { color: #2563eb; text-decoration: underline; }
.paper-row-summary {
  font-size: 12.5px;
  color: #4b5563;
  line-height: 1.6;
  margin-bottom: 4px;
}
.paper-row-source {
  font-size: 11px;
  color: #9ca3af;
}
.papers-empty {
  color: #9ca3af;
  font-size: 12px;
  text-align: center;
  padding: 14px;
}

/* ===== Sources View ===== */
.sources-view { width: 100%; }
.sources-table-wrap {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
}
.sources-table-wrap h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}
.sources-table-note {
  font-size: 11px;
  color: #9ca3af;
  margin: 0 0 16px;
  line-height: 1.5;
}
/* 카테고리 탭 row + 우측 inline 기간 dropdown (소스 현황 view 전용) */
.category-bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}
.category-bar-row .category-bar {
  flex: 1 1 auto;
  min-width: 0;
}
.category-bar-aside {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.category-bar-aside.hidden { display: none; }
.sources-control-label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}
.category-bar-aside select {
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
}
.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.trend-view-tabs {
  display: flex;
  background: #f3f4f6;
  padding: 3px;
  border-radius: 8px;
  gap: 2px;
}
.trend-view-tab {
  padding: 6px 14px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12.5px;
  color: #6b7280;
  font-weight: 500;
}
.trend-view-tab.active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* 소스 표 — 가로 스크롤 허용 + 컬럼 너비 명시 */
.sources-table-scroll {
  overflow-x: auto;
}
.src-table { width: 100%; border-collapse: collapse; min-width: 900px; }
.src-table th, .src-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 13px;
  white-space: nowrap;
}
.src-table th {
  background: #f9fafb;
  font-weight: 600;
  color: #4b5563;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.src-table .col-name { width: 240px; }
.src-table .col-type { width: 90px; }
.src-table .col-status { width: 90px; }
.src-table .col-num { width: 110px; text-align: right; }
.src-table .col-date { width: 120px; }
.src-table .col-url { width: auto; min-width: 250px; }
.src-table td.num-cell { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; color: #0f172a; }
.src-table td.src-name { font-weight: 500; color: #0f172a; }
.src-table td.src-url {
  font-size: 11.5px;
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.src-table td.src-url a { color: #6b7280; }
.src-table td.src-url a:hover { color: #2563eb; text-decoration: underline; }
.src-table .badge-active { color: #16a34a; font-weight: 600; }
.src-table .badge-idle { color: #9ca3af; }
.type-badge {
  display: inline-block;
  padding: 3px 9px;
  background: #eef2ff;
  color: #4338ca;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.type-badge.type-arxiv { background: #fef3c7; color: #92400e; }
.type-badge.type-semantic_scholar { background: #ddd6fe; color: #6d28d9; }
.type-badge.type-naver { background: #d1fae5; color: #065f46; }
.type-badge.type-google_news { background: #fee2e2; color: #991b1b; }
.type-badge.type-korean { background: #dbeafe; color: #1e40af; }
.src-table .badge-error { color: #dc2626; }

/* ===== Empty State ===== */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: #9ca3af;
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
}
.empty-state .empty-icon { font-size: 36px; margin-bottom: 12px; opacity: 0.5; }
.empty-state .empty-title { font-size: 15px; font-weight: 600; color: #4b5563; margin-bottom: 6px; }
.empty-state .empty-desc { font-size: 13px; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .content { padding: 20px; }
}
@media (max-width: 768px) {
  /* v6.15.39 (P3-9): 70px 아이콘바 → 햄버거로 여닫는 오프캔버스 드로어 (라벨 유지) */
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 240px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 60;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 2px 0 16px rgba(0,0,0,0.3);
  }
  .sidebar-toggle { display: flex; }
  .sidebar-overlay.open { display: block; }
  /* v6.15.40: 햄버거(top:10, 40px)와 topbar 제목 정렬. 상단 정렬 + 좌측 여백.
     v6.15.41: 제목 약간 더 우측(66px), 메타는 제목 첫 줄과 수평(flex-start) */
  .topbar { align-items: flex-start; padding-left: 66px; }
  /* v6.15.41: 제목/힌트 세로 스택 — 힌트는 한 줄(nowrap)로 제목과 좌측 정렬 */
  .topbar-title { flex-direction: column; align-items: flex-start; gap: 2px; }
  .view-hint { white-space: nowrap; }
  /* v6.15.43: 모바일에선 우측 '최근 갱신' 메타 숨김 (3줄 줄바꿈·잘림 정리, 사용자 요청) */
  .topbar-meta { display: none; }
  .content { padding: 16px; overflow-x: hidden; }  /* 가로 스크롤/넘침 방지 */
  /* v6.15.43: 기간 탭 + 일자 필터를 한 줄에 (탭 축소로 폭 확보), meta/요약은 아래 줄 */
  .strategy-controls { flex-wrap: wrap; gap: 8px; row-gap: 10px; padding: 10px 12px; }
  .strategy-period-tabs { order: 1; }
  .period-tab { padding: 6px 11px; font-size: 12px; }
  #papers-period-select, #strategy-period-select { order: 2; padding: 6px 10px; font-size: 12px; }
  .papers-meta-inline { order: 3; flex-basis: 100%; margin: 0; }
  #strategy-summary-inline { order: 3; flex-basis: 100%; }
  /* v6.15.43: 엔티티/지식그래프 가로 넘침 정리 */
  .entity-grid { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
  .graph-view, .graph-container { overflow-x: hidden; max-width: 100%; }
  #graph-svg { max-width: 100%; }
}

/* ========================= Phase 2b: 엔티티 페이지 (v5.0: 폰트 ~50% 상향) ========================= */
.entities-view { padding: 0; }
.entities-summary {
  color: #4b5563; font-size: 18px; padding: 10px 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.entity-type-section { margin-bottom: 36px; }
.entity-type-title { font-size: 22px; color: #1f2937; margin: 14px 0 14px; display: flex; align-items: center; gap: 10px; font-weight: 600; }
.entity-type-count { font-size: 16px; color: #555; background: #f0f0f0; padding: 4px 12px; border-radius: 12px; font-weight: 500; }
.entity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.entity-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 18px 20px; cursor: pointer; transition: all 0.15s;
}
.entity-card:hover { border-color: #3b82f6; box-shadow: 0 2px 8px rgba(59,130,246,0.12); transform: translateY(-1px); }
.entity-name { font-size: 18px; font-weight: 600; color: #1f2937; margin-bottom: 10px; }
.entity-meta { display: flex; gap: 14px; font-size: 16px; color: #4b5563; margin-bottom: 8px; }
.entity-mentions strong { color: #1f2937; font-weight: 600; }
.entity-avgscore { color: #6b7280; }
.entity-foot { display: flex; gap: 8px; flex-wrap: wrap; }
.entity-pill {
  font-size: 14px; background: #eef2ff; color: #4f46e5;
  padding: 4px 10px; border-radius: 8px; font-weight: 500;
}
/* 상세 */
.entity-back-btn {
  background: none; border: none; color: #3b82f6; cursor: pointer;
  font-size: 17px; padding: 8px 0; margin-bottom: 14px; font-weight: 500;
}
.entity-back-btn:hover { text-decoration: underline; }
.entity-detail-head h2 { margin: 0 0 14px; font-size: 30px; color: #1f2937; font-weight: 700; }
.entity-detail-meta { display: flex; gap: 18px; color: #4b5563; font-size: 17px; flex-wrap: wrap; margin-bottom: 26px; align-items: center; }
.entity-detail-meta strong { color: #1f2937; font-weight: 600; }
.entity-type-badge { background: #eef2ff; color: #4f46e5; padding: 4px 14px; border-radius: 6px; font-weight: 500; font-size: 15px; }
.entity-section { margin-bottom: 32px; }
.entity-section h3 { font-size: 20px; color: #1f2937; margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid #e5e7eb; font-weight: 600; }
.entity-list { list-style: none; padding: 0; margin: 0; }
.entity-list li { padding: 12px 0; border-bottom: 1px solid #f3f4f6; font-size: 16px; color: #374151; line-height: 1.5; }
.entity-list li:last-child { border-bottom: none; }
.entity-list-meta { font-size: 14px; color: #6b7280; }
.entity-articles a { color: #2563eb; text-decoration: none; font-size: 16px; }
.entity-articles a:hover { text-decoration: underline; }
.empty-state { text-align: center; padding: 60px 20px; color: #9ca3af; font-size: 16px; }

/* v5.0: 시사점·논문 흐름 클릭 가능한 행 */
.entity-link-row { cursor: pointer; padding: 12px 14px !important; border-radius: 8px; transition: background 0.15s; display: flex; flex-direction: column; gap: 4px; border-bottom: 1px solid #f3f4f6 !important; }
.entity-link-row:hover { background: #f3f4f6; }
.entity-link-row .entity-link-text { color: #1f2937; font-weight: 500; }
.entity-link-row .entity-list-meta { color: #6b7280; font-size: 14px; font-weight: 500; }

/* v5.0: 논문 토글 (entities-summary 우측) */
.entity-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: #374151; cursor: pointer; user-select: none; }
.entity-toggle input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: #4f46e5; }

/* ========================= Phase 3 / v5.0: 관련 엔티티 + 지식그래프 (폰트 50% 상향) ========================= */

/* 엔티티 상세 — 관련 엔티티 섹션 */
.entity-relations-section { background: #fafbfc; padding: 18px 22px; border-radius: 12px; border: 1px solid #e5e7eb; margin-bottom: 32px; }
.entity-relations-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.entity-relations-head h3 { margin: 0; border-bottom: none; padding-bottom: 0; font-size: 20px; }
.entity-relations-loading,
.entity-relations-empty {
  font-size: 14px; color: #9ca3af; font-weight: normal; margin-left: 8px;
}
.entity-relations-hint { font-size: 14px; color: #9ca3af; margin: 6px 0 0; }
.entity-relations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.entity-relation-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px 16px;
  cursor: pointer; transition: all 0.15s;
}
.entity-relation-card:hover {
  border-color: #3b82f6; box-shadow: 0 2px 10px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
}
.entity-relation-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.entity-relation-name { font-weight: 600; color: #1f2937; font-size: 17px; }
.entity-relation-other-type {
  font-size: 12px; color: #6b7280; background: #f3f4f6; padding: 2px 8px; border-radius: 6px;
}
/* v5.0: 관계 타입 칩 (여러 개 한 카드에) */
.entity-relation-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.entity-relation-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; padding: 4px 10px; border-radius: 6px;
  font-weight: 500;
}
.entity-relation-chip .chip-arrow { font-size: 12px; opacity: 0.8; }
.entity-relation-evidence {
  font-size: 14px; color: #4b5563; margin-top: 8px;
  line-height: 1.55; padding: 8px 10px; background: #f9fafb; border-radius: 6px;
  border-left: 3px solid #d1d5db;
}
.entity-relation-evidence .evidence-type-marker {
  font-size: 11px; font-weight: 600; margin-right: 6px; text-transform: uppercase; letter-spacing: 0.3px;
}

/* 지식그래프 view */
.graph-view { padding: 14px 4px; }
.graph-controls {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-bottom: 12px;
}
.graph-controls-label { font-size: 15px; color: #4b5563; margin-right: 4px; font-weight: 500; }
.graph-filter-btn {
  font-size: 14px; padding: 6px 14px; border-radius: 6px;
  border: 1px solid #d1d5db; background: #fff; color: #374151;
  cursor: pointer; transition: all 0.15s; font-weight: 500;
}
.graph-filter-btn:hover { background: #f3f4f6; }
.graph-filter-btn.active {
  background: #1f2937; color: #fff; border-color: #1f2937;
}
/* v5.0: 그래프 옵션 행 (논문 포함 / 고립 노드 토글) */
.graph-options {
  display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
  margin-bottom: 10px; padding: 6px 4px;
}
.graph-meta { font-size: 15px; color: #4b5563; margin-bottom: 10px; padding: 0 4px; }
.graph-meta strong { color: #1f2937; font-weight: 600; }
.graph-container {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  overflow: hidden; position: relative;
}
.graph-container svg { display: block; cursor: grab; }
.graph-container svg:active { cursor: grabbing; }
.graph-tip { font-size: 14px; color: #6b7280; text-align: center; margin-top: 10px; }
.graph-links line { transition: stroke-opacity 0.15s; }
.graph-node:hover circle { stroke: #1f2937; stroke-width: 2.5; }
.graph-node text { pointer-events: none; user-select: none; }
