/* MoaBriefing 공개 웹 - style.css (v17.2 포털형 리디자인)
   Tailwind CDN으로 대부분 처리. 이 파일은 아래 항목만 담당:
   1) SPA 라우팅 (page-content 숨김/표시)
   2) 다크 모드 (body.dark-theme 클래스 기반 CSS 변수)
   3) JS 동적 생성 클래스 스타일 (뉴스 카드, 캘린더, 커뮤니티 테이블 등)
   4) 법적 페이지 본문 (.legal-content, v18.10)
   5) 애니메이션 (스피너, ticker 스크롤, 페이지 전환, skeleton shimmer)
   6) 헤더/내비 동적 active 상태 (JS가 classList로 토글)
   7) Bento Grid 피드, Glassmorphism 헤더, 반응형 개선
*/

/* =========================================
   RESET
   ========================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* =========================================
   CSS 변수 (라이트 기본값)
   ========================================= */
:root {
  --accent:       #2563eb;
  --accent-hover: #1d4ed8;
  --accent-muted: rgba(37, 99, 235, 0.08);
  --positive:    #dc2626;
  --positive-bg: rgba(220, 38, 38, 0.08);
  --negative:    #2563eb;
  --negative-bg: rgba(37, 99, 235, 0.08);
  --neutral:     #6b7280;
  --neutral-bg:  rgba(107, 114, 128, 0.08);
  --text-primary:   #0f172a;
  --text-secondary: #64748b;
  --text-muted:     #94a3b8;
  --text-link:      #2563eb;
  --bg-card:    #ffffff;
  --bg-base:    #f5f7fa;
  --border:     #e2e8f0;
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.05);
  --shadow:     0 4px 6px -1px rgba(0,0,0,0.10), 0 2px 4px -2px rgba(0,0,0,0.10);
  --shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.10), 0 4px 6px -4px rgba(0,0,0,0.10);
  --ai-color:   #7c3aed;
  --ai-bg:      rgba(124, 58, 237, 0.08);
  --pro-color:  #b45309;
  --pro-bg:     rgba(180, 83, 9, 0.08);
  --font:       'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, 'system-ui', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  --font-mono:  'SFMono-Regular', Consolas, monospace;
  --transition: 0.15s ease;
  --header-height: 56px;
  --ticker-height: 0px;
  --imp-high: #ef4444;
  --imp-mid:  #f59e0b;
  --imp-low:  #9ca3af;
  --warning:  #d97706;
  --success:  #059669;
  --imp-high: #ef4444;
  --imp-mid:  #f59e0b;
  --imp-low:  #9ca3af;
}

/* 다크 테마 오버라이드 (body.dark-theme 클래스) */
body.dark-theme {
  --accent:       #58a6ff;
  --accent-hover: #79b8ff;
  --accent-muted: rgba(88, 166, 255, 0.10);
  --positive:    #f85149;
  --positive-bg: rgba(248, 81, 73, 0.10);
  --negative:    #58a6ff;
  --negative-bg: rgba(88, 166, 255, 0.10);
  --neutral:     #8b949e;
  --neutral-bg:  rgba(139, 148, 158, 0.08);
  --text-primary:   #e6edf3;
  --text-secondary: #8b949e;
  --text-muted:     #6e7681;
  --text-link:      #58a6ff;
  --bg-card:    #161b22;
  --bg-base:    #0d1117;
  --border:     #21262d;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.40);
  --shadow:     0 4px 16px rgba(0,0,0,0.50);
  --shadow-lg:  0 10px 24px rgba(0,0,0,0.60);
  --ai-color:   #a78bfa;
  --ai-bg:      rgba(167, 139, 250, 0.10);
  --pro-color:  #f59e0b;
  --pro-bg:     rgba(245, 158, 11, 0.10);
  --imp-high: #f85149;
  --imp-mid:  #d29922;
  --imp-low:  #6e7681;
}

/* Tailwind dark: 클래스 동기화 (body.dark-theme -> html.dark) */
/* Tailwind darkMode: 'class' 설정이므로 html에 dark 클래스 필요 */
/* app.js의 applyTheme()이 body.dark-theme를 토글하므로 여기서 html도 토글 */

/* =========================================
   GLASSMORPHISM 헤더
   ========================================= */
.top-bar {
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(226, 232, 240, 0.5);
}
body.dark-theme .top-bar {
  background: rgba(22, 27, 34, 0.96);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.30), 0 0 0 1px rgba(33, 38, 45, 0.8);
}

/* 헤더 하단 브랜드 그라데이션 라인 */
.top-bar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, #7c3aed 50%, #ec4899 100%);
  opacity: 0.55;
  pointer-events: none;
}

/* =========================================
   BASE
   ========================================= */
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font);
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg-base);
  background-image:
    radial-gradient(circle at 20% 50%, rgba(37, 99, 235, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(124, 58, 237, 0.02) 0%, transparent 50%);
  background-attachment: fixed;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition), color var(--transition);
}
body.dark-theme {
  background-image:
    radial-gradient(circle at 20% 50%, rgba(88, 166, 255, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(167, 139, 250, 0.02) 0%, transparent 50%);
}

/* 다크 테마 시 Tailwind dark: 트리거 */
body.dark-theme { color-scheme: dark; }

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent-hover); }
ul { list-style: none; }

/* =========================================
   SPA 라우팅 (핵심 — 절대 삭제 금지)
   ========================================= */
.page-content {
  display: none;
  animation: page-in 0.15s ease-out;
}

.page-content.active {
  display: block;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 탭 바: wrap 레이아웃, 모바일에서만 스크롤 */

/* =========================================
   HEADER 네비게이션 active 상태
   (JS가 classList.add('active')로 토글)
   ========================================= */
.nav-link {
  font-weight: 600;
  font-size: 14px;
}
/* hover: Tailwind hover:bg-blue-50 보다 더 진한 색으로 CSS 명시 (specificity 보장) */
.nav-link:hover {
  background-color: #EFF6FF !important;
  color: #2563EB !important;
}
/* active: hover보다 확실히 구분되는 더 진한 배경 */
.nav-link.active {
  color: #1D4ED8 !important;
  background: #DBEAFE !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
}

body.dark-theme .nav-link:hover {
  background-color: #1E3A5F !important;
  color: #93C5FD !important;
}
body.dark-theme .nav-link.active {
  color: #93C5FD !important;
  background: #1E3A5F !important;
  font-weight: 700 !important;
}

/* 모바일 메뉴 열기 */
@media (max-width: 767px) {
  .main-nav.nav-open {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 8px 16px 16px;
    z-index: 100;
    gap: 4px;
  }

  /* 헤더 인증 그룹(로그인/회원가입/마이페이지) — 모바일에서 숨김.
     JS가 auth-guest/auth-user 자식 요소의 style.display를 직접 제어하므로
     wrapper(.header-auth-wrap)를 숨겨서 JS 로직과 충돌 없이 처리한다. */
  .header-auth-wrap {
    display: none !important;
  }

  /* 모바일 드로어 전용 인증 영역 */
  .mobile-nav-auth {
    width: 100%;
    border-top: 1px solid var(--border);
    margin-top: 4px;
    padding-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
}

/* 데스크톱에서는 mobile-nav-auth 완전 숨김 */
@media (min-width: 768px) {
  .mobile-nav-auth {
    display: none !important;
  }
}

/* 모바일 드로어 auth 버튼 공통 스타일 */
.mobile-nav-auth-btn {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.mobile-nav-auth-btn:hover {
  background: var(--accent-muted);
  color: var(--accent);
}
.mobile-nav-auth-btn.primary {
  background: var(--accent);
  color: #fff;
  margin-top: 4px;
  text-align: center;
}
.mobile-nav-auth-btn.primary:hover {
  background: var(--accent-hover, #1d4ed8);
  color: #fff;
}

/* =========================================
   테마 아이콘 버튼
   ========================================= */
.theme-icon::before { content: '☀'; }
body.dark-theme .theme-icon::before { content: '☽'; }

/* =========================================
   ROTATION 탭 버튼 (JS 동적 생성)
   ========================================= */
.rotation-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.rotation-tab:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-muted);
}
.rotation-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}
body.dark-theme .rotation-tab.active {
  box-shadow: 0 2px 4px rgba(88, 166, 255, 0.3);
}

/* 더보기 버튼 */
.rotation-tab-more {
  background: transparent !important;
  border: 1px dashed var(--border) !important;
  color: var(--text-muted) !important;
  font-weight: 500 !important;
}
.rotation-tab-more:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  background: var(--accent-muted) !important;
}
.rotation-tab-more.active-more {
  border-style: solid !important;
  color: var(--accent) !important;
}

/* 숨겨진 섹터 탭 컨테이너 */
.rotation-tabs-hidden {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  width: 100%;
}

/* 이슈 로테이션 피드: 전환 애니메이션 */
.rotation-feed {
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.rotation-feed.fade-out {
  opacity: 0;
  transform: translateY(6px);
}

/* =========================================
   ROTATION PROGRESS DOTS (JS 동적 생성)
   ========================================= */
.rotation-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}
.rotation-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.3s ease;
  cursor: pointer;
  flex-shrink: 0;
}
.rotation-dot.active {
  width: 22px;
  border-radius: 4px;
  background: var(--accent);
}
.rotation-dot:hover:not(.active) {
  background: var(--text-muted);
}

/* =========================================
   NEWS ITEM LIST (번호 카드 리스트 — rotation-feed)
   ========================================= */
.news-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-primary);
  transition: background 0.2s ease, transform 0.2s ease;
  position: relative;
}
.news-item:last-child { border-bottom: none; }
.news-item:hover {
  background: var(--accent-muted);
  transform: translateX(4px);
}
.news-item-first {
  border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, var(--accent-muted) 0%, transparent 50%);
}
.news-item-first:hover {
  background: linear-gradient(90deg, rgba(37,99,235,0.12) 0%, var(--accent-muted) 100%);
}
body.dark-theme .news-item-first {
  background: linear-gradient(90deg, rgba(88,166,255,0.10) 0%, transparent 50%);
}
body.dark-theme .news-item-first:hover {
  background: linear-gradient(90deg, rgba(88,166,255,0.15) 0%, rgba(88,166,255,0.08) 100%);
}

.news-item-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-width: 40px;
}
.news-item-num {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.news-item:nth-child(n+4) .news-item-num { color: var(--text-muted); }
.news-item-left .sent-badge {
  font-size: 10px;
  padding: 2px 6px;
}

.news-item-content { flex: 1; min-width: 0; }

.news-item-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text-primary);
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-item-first .news-item-title {
  font-size: 16px;
  font-weight: 800;
  -webkit-line-clamp: 2;
}

/* 기사 헤더 행 (제목 + 감성 배지) */
.news-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.news-item-header .news-item-title { margin-bottom: 0; }

/* 감성 배지 */
.sent-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.4;
}
/* 한국 주식 관례: 상승=빨강, 하락=파랑 */
.sent-pos { background: var(--positive-bg); color: var(--positive); }
.sent-neg { background: var(--negative-bg); color: var(--negative); }
.sent-neu { background: var(--neutral-bg);  color: var(--neutral); }

/* AI 요약 블록 */
.news-item-ai {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--ai-bg);
  border-radius: 8px;
  margin: 4px 0;
  border-left: 3px solid var(--ai-color);
  overflow: hidden;
}
.ai-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ai-color);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 1px;
  letter-spacing: 0.5px;
}
.ai-text {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

/* 키워드 태그 (기사 하단) */
.news-item-tags {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.kw-tag {
  display: inline-flex;
  padding: 1px 8px;
  border-radius: 99px;
  font-size: 11px;
  background: var(--accent-muted);
  color: var(--accent);
  white-space: nowrap;
}

.news-item-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-item-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
  width: 72px;
  min-width: 72px;
}
.news-item-source {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.news-item-time {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* =========================================
   SKELETON LOADING
   ========================================= */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, rgba(255,255,255,0.15) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}
body.dark-theme .skeleton {
  background: linear-gradient(90deg, var(--border) 25%, rgba(255,255,255,0.06) 50%, var(--border) 75%);
  background-size: 200% 100%;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.skeleton-title { width: 70%; height: 18px; margin-bottom: 12px; }
.skeleton-text  { width: 100%; height: 14px; margin-bottom: 8px; }
.skeleton-text-short { width: 40%; height: 14px; }
.skeleton-meta  { width: 30%; height: 12px; margin-top: 12px; }

/* =========================================
   BENTO FEED GRID
   ========================================= */
.feed-bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.feed-bento .hero-card {
  grid-column: span 2;
  grid-row: span 2;
}
@media (max-width: 1023px) {
  .feed-bento { grid-template-columns: repeat(2, 1fr); }
  .feed-bento .hero-card { grid-column: span 2; grid-row: span 1; }
}
@media (max-width: 639px) {
  .feed-bento { grid-template-columns: 1fr; gap: 12px; }
  .feed-bento .hero-card { grid-column: span 1; }
}

/* 카드 등장 stagger */
@keyframes card-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.feed-bento > .news-card {
  animation: card-in 0.3s ease-out both;
}
.feed-bento > .news-card:nth-child(1) { animation-delay: 0s; }
.feed-bento > .news-card:nth-child(2) { animation-delay: 0.05s; }
.feed-bento > .news-card:nth-child(3) { animation-delay: 0.10s; }
.feed-bento > .news-card:nth-child(4) { animation-delay: 0.15s; }
.feed-bento > .news-card:nth-child(5) { animation-delay: 0.20s; }
.feed-bento > .news-card:nth-child(6) { animation-delay: 0.25s; }
.feed-bento > .news-card:nth-child(n+7) { animation-delay: 0.30s; }

/* =========================================
   FEED LIST (포털형 이슈 피드 — feed-list)
   ========================================= */
.feed-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
body.dark-theme .feed-list {
  box-shadow: 0 2px 8px rgba(0,0,0,0.20);
}

/* feed-list 내 pagination: grid-column 불필요 (flex 컨테이너가 아님) */
.feed-list .feed-pagination {
  margin: 0;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-base);
}
.feed-list .feed-pagination:first-child {
  border-top: none;
  border-bottom: 1px solid var(--border);
  background: var(--bg-base);
}
body.dark-theme .feed-list .feed-pagination {
  background: rgba(255,255,255,0.01);
}

/* 리스트형 기사 등장 stagger */
@keyframes item-in {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}
.feed-list .news-item {
  animation: item-in 0.25s ease-out both;
}
.feed-list .news-item:nth-child(2) { animation-delay: 0.04s; }
.feed-list .news-item:nth-child(3) { animation-delay: 0.08s; }
.feed-list .news-item:nth-child(4) { animation-delay: 0.12s; }
.feed-list .news-item:nth-child(5) { animation-delay: 0.16s; }
.feed-list .news-item:nth-child(n+6) { animation-delay: 0.20s; }

/* =========================================
   NEWS CARD (JS 동적 생성 — rotation-feed, feed-bento)
   ========================================= */
.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
  display: flex;
  flex-direction: column;
}
.news-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  z-index: 1;
  position: relative;
}

/* Hero 카드 */
.hero-card { padding: 24px; }
.hero-card .news-title { font-size: 20px; font-weight: 800; line-height: 1.3; }
.hero-card .news-summary { -webkit-line-clamp: 3; font-size: 14px; }
@media (max-width: 639px) {
  .hero-card .news-title { font-size: 18px; }
  .hero-card { padding: 16px 20px; }
}

.news-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.news-time {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.news-source-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-muted);
  padding: 1px 7px;
  border-radius: 99px;
}

.news-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.45;
  margin-bottom: 8px;
}

.news-title a {
  color: inherit;
  transition: color var(--transition);
}
.news-title a:hover { color: var(--accent); }

/* AI 요약 박스 */
.news-card-badge {
  margin-bottom: 4px;
}

.news-ai-summary {
  background: var(--ai-bg);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  overflow: hidden;
}

.ai-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ai-color);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* AI 배지 (뉴스카드 footer용) */
.ai-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 600;
  background: var(--ai-bg);
  color: var(--ai-color);
  white-space: nowrap;
}

.ai-text-short, .ai-text-full {
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.5;
}

.news-ai-summary .ai-text-short {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.ai-more-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
}
.ai-more-btn:hover { text-decoration: underline; }

.news-summary {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.news-card-body { margin-bottom: 4px; flex: 1; display: flex; flex-direction: column; }

/* 키워드 태그 */
.news-tag {
  display: inline-flex;
  padding: 1px 8px;
  border-radius: 99px;
  font-size: 11px;
  background: var(--accent-muted);
  color: var(--accent);
  white-space: nowrap;
}
.news-tags { display: flex; gap: 4px; flex-wrap: wrap; }

.news-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.news-read-more {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}
.news-read-more:hover { text-decoration: underline; }

/* 감성 필 (pill — 한국 주식 관례: 상승=빨강, 하락=파랑) */
.sentiment-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  margin-left: auto;
  flex-shrink: 0;
}
.sentiment-pill.positive { background: var(--positive-bg); color: var(--positive); }
.sentiment-pill.negative { background: var(--negative-bg); color: var(--negative); }
.sentiment-pill.neutral  { background: var(--neutral-bg);  color: var(--neutral); }
.sentiment-icon { font-size: 10px; }

/* =========================================
   ISSUE 탭 (pill, JS 동적 생성 — issue-tab-bar)
   ========================================= */
.issue-tab {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.issue-tab:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-muted);
}
.issue-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}
body.dark-theme .issue-tab.active {
  box-shadow: 0 2px 4px rgba(88, 166, 255, 0.3);
}

.tab-count {
  font-size: 11px;
  opacity: 0.8;
  margin-left: 3px;
}

/* 공시 탭 -- 이슈 탭과 동일 베이스에 구분 색상 오버라이드 */
.issue-tab-disclosure {
  border-color: #d97706;
  color: #92400e;
}
body.dark-theme .issue-tab-disclosure {
  border-color: #b45309;
  color: #fcd34d;
}
.issue-tab-disclosure:hover {
  color: #d97706;
  border-color: #d97706;
  background: rgba(217, 119, 6, 0.08);
}
.issue-tab-disclosure.active {
  background: #d97706;
  border-color: #d97706;
  color: #fff;
  box-shadow: 0 2px 4px rgba(217, 119, 6, 0.35);
}
body.dark-theme .issue-tab-disclosure.active {
  background: #b45309;
  border-color: #b45309;
  box-shadow: 0 2px 4px rgba(180, 83, 9, 0.45);
}

/* 공시 출처 뱃지 (DART 구분) */
.disclosure-badge {
  background: rgba(217, 119, 6, 0.10);
  color: #92400e;
  border: 1px solid rgba(217, 119, 6, 0.25);
}
body.dark-theme .disclosure-badge {
  background: rgba(180, 83, 9, 0.15);
  color: #fcd34d;
  border-color: rgba(180, 83, 9, 0.35);
}

/* 공시 기업명 태그 */
.disclosure-companies {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0 2px;
}
.disclosure-company-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent);
  border: 1px solid rgba(37, 99, 235, 0.18);
  white-space: nowrap;
}

/* =========================================
   공시 기업 필터 (JS 동적 생성)
   ========================================= */
#disclosure-company-filter {
  padding: 8px 0 4px;
}

.company-search-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}

.company-search-input-wrap {
  position: relative;
  flex: 1;
}

.disclosure-company-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.disclosure-company-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}
.disclosure-company-input::placeholder {
  color: var(--text-muted);
}

.disclosure-search-btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.disclosure-search-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.disclosure-clear-btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.disclosure-clear-btn:hover {
  background: var(--neutral-bg);
  color: var(--text-secondary);
}

.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 100;
  max-height: 240px;
  overflow-y: auto;
}

.autocomplete-item {
  padding: 9px 14px;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition);
  user-select: none;
}
.autocomplete-item:first-child {
  border-radius: 8px 8px 0 0;
}
.autocomplete-item:last-child {
  border-radius: 0 0 8px 8px;
}
.autocomplete-item:only-child {
  border-radius: 8px;
}
.autocomplete-item:hover,
.autocomplete-item:focus {
  background: var(--accent-muted);
  outline: none;
}

.disclosure-active-filter {
  padding: 6px 0 2px;
  font-size: 12px;
  color: var(--text-secondary);
}
.disclosure-filter-label {
  display: inline-block;
  padding: 2px 10px;
  background: rgba(217, 119, 6, 0.10);
  color: #92400e;
  border: 1px solid rgba(217, 119, 6, 0.25);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
body.dark-theme .disclosure-filter-label {
  background: rgba(180, 83, 9, 0.15);
  color: #fcd34d;
  border-color: rgba(180, 83, 9, 0.35);
}

/* =========================================
   FEED 페이지네이션 (JS 동적 생성)
   ========================================= */
.feed-pagination {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
}

.feed-page-size {
  display: flex;
  gap: 6px;
}

.feed-page-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto;
}

.page-size-btn, .page-nav-btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.page-size-btn:hover, .page-nav-btn:hover { color: var(--accent); border-color: var(--accent); }
.page-size-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.page-info {
  font-size: 12px;
  color: var(--text-muted);
  padding: 0 4px;
}

/* =========================================
   SPINNER
   ========================================= */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =========================================
   커뮤니티 테이블 (JS 동적 생성)
   ========================================= */
.comm-table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
}

.comm-table th, .comm-table td {
  padding: 10px 12px;
  vertical-align: middle;
}

.comm-table tbody tr {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.comm-table tbody tr:hover { background: var(--bg-base); }
body.dark-theme .comm-table tbody tr:hover { background: #1c2128; }

.col-title { text-align: left !important; max-width: 0; width: 99%; }
.col-num, .col-category, .col-author, .col-date, .col-views, .col-likes { text-align: center; white-space: nowrap; }

.post-title-text {
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  max-width: 400px;
}

.post-comments {
  font-size: 12px;
  color: var(--accent);
  margin-left: 4px;
}

.post-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  background: var(--accent-muted);
  color: var(--accent);
  font-size: 11px;
  border-radius: 4px;
  white-space: nowrap;
}

.col-author-inner {
  display: block;
  max-width: 80px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 auto;
}

.post-likes-up {
  color: var(--positive);
  font-weight: 600;
}

.hot-tag {
  color: var(--accent);
  font-weight: 600;
}

/* 커뮤니티 페이지네이션 래퍼 — 중앙 정렬 보강 (Tailwind justify-center 보조) */
#community-pagination, .community-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  margin-bottom: 16px;
}

/* 커뮤니티 페이지네이션 버튼 (JS 동적 생성) */
.comm-page-btn {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.comm-page-btn:hover:not([disabled]) { color: var(--accent); border-color: var(--accent); }
.comm-page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.comm-page-btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* 인기글 HOT */
.comm-hot-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.comm-hot-item:last-child { border-bottom: none; }

.hot-likes {
  font-size: 11px;
  color: var(--positive);
  font-weight: 600;
  margin-left: auto;
}

/* 인기글 사이드바 (market 페이지) */
.hot-post-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: color var(--transition);
}
.hot-post-item:last-child { border-bottom: none; }
.hot-post-item:hover { color: var(--accent); }

.hot-post-rank {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  width: 18px;
  flex-shrink: 0;
  text-align: center;
}
.hot-post-rank.top3 { color: #ff6b00; font-weight: 800; }
body.dark-theme .hot-post-rank.top3 { color: #f59e0b; }

.hot-post-content { flex: 1; min-width: 0; }

.hot-post-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.hot-post-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.sidebar-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 0;
}

.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.empty-state-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.empty-state-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

/* 이슈피드 로그인 프롬프트 */
.feed-login-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
  grid-column: 1 / -1;
}
.feed-login-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent-muted);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.feed-login-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.feed-login-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.feed-login-actions {
  display: flex;
  gap: 10px;
}
.feed-login-btn {
  padding: 12px 32px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--transition);
}
.feed-login-btn-primary {
  background: var(--accent);
  color: #fff;
}
.feed-login-btn-primary:hover {
  background: var(--accent-hover);
}
.feed-login-btn-secondary {
  background: var(--bg-card);
  color: var(--accent);
  border: 1px solid var(--accent);
}
.feed-login-btn-secondary:hover {
  background: var(--accent-muted);
}

/* =========================================
   캘린더 (JS 전체 동적 생성)
   ========================================= */
/* ============================== 경제 캘린더 ============================== */

/* --- 월별 뷰 헤더 --- */
.cal-month-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.cal-month-label {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  flex: 1;
  text-align: center;
  letter-spacing: -0.02em;
  cursor: pointer;
}
.cal-month-label:hover {
  color: var(--accent);
  text-decoration: underline;
}

.cal-nav-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
}
.cal-nav-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-muted); }

#btn-month-today {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 700;
}
#btn-month-today:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* --- 범례 --- */
.cal-legend {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.cal-legend-item { display: flex; align-items: center; gap: 6px; }

/* --- 요일 헤더 --- */
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 6px;
}

.cal-weekday {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 8px 0;
}
.cal-weekday:first-child { color: #dc2626; }
.cal-weekday:last-child { color: #2563eb; }

/* --- 날짜 그리드 --- */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 16px;
}

.cal-cell {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  min-height: 70px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
  overflow: hidden;
}
.cal-cell:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(37,99,235,0.1); }
.cal-cell.cal-cell-today { border-color: var(--accent); background: var(--accent-muted); border-width: 2px; }
.cal-cell.cal-cell-empty { background: transparent; border-color: transparent; cursor: default; min-height: 0; }
.cal-cell.cal-cell-empty:hover { box-shadow: none; }

/* --- 일/토 색상 --- */
.cal-cell-sun .cal-day-num { color: #dc2626; }
.cal-cell-sat .cal-day-num { color: #2563eb; }
body.dark-theme .cal-cell-sun .cal-day-num { color: #f87171; }
body.dark-theme .cal-cell-sat .cal-day-num { color: #60a5fa; }

.cal-day-num {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
  text-align: right;
  margin-bottom: 4px;
  line-height: 1;
}
.cal-cell.cal-cell-today .cal-day-num {
  color: var(--accent);
  font-weight: 800;
}

/* --- 셀 내 이벤트 --- */
.cal-cell-events {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cal-evt {
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.cal-evt.cal-evt-high { background: rgba(239, 68, 68, 0.15); color: #dc2626; font-weight: 600; }
.cal-evt.cal-evt-mid  { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.cal-evt.cal-evt-low  { background: rgba(107, 114, 128, 0.12); color: #6b7280; }

.cal-evt-status { font-size: 9px; opacity: 0.7; margin-left: 2px; }
.cal-evt-more { font-size: 10px; color: var(--accent); font-weight: 600; padding: 1px 4px; cursor: pointer; }

.cal-cell-summary { display: flex; flex-direction: column; align-items: center; gap: 2px; padding-top: 2px; }
.cal-cell-count { font-size: 13px; font-weight: 700; color: var(--accent); line-height: 1; }
.cal-cell-dots { display: flex; gap: 4px; align-items: center; }
.cal-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.cal-dot.dot-high { background: #dc2626; }
.cal-dot.dot-mid { background: #d97706; }
.cal-dot.dot-low { background: #9ca3af; }

.cal-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 12px;
  text-align: center;
}

/* --- 일별 상세 뷰 --- */
.cal-daily-header {
  margin-bottom: 20px;
}

.cal-back-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
  margin-bottom: 16px;
}
.cal-back-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-muted); }

.date-nav-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.date-nav-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: all var(--transition);
}
.date-nav-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-muted); }

.date-label {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  flex: 1;
  text-align: center;
  letter-spacing: -0.02em;
  cursor: pointer;
}
.date-label:hover {
  color: var(--accent);
  text-decoration: underline;
}

.btn-today {
  padding: 8px 18px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-today:hover { background: var(--accent-hover); }

/* 중요도 필터 */
.importance-filter {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 5px;
}
.filter-chip:hover { color: var(--accent); border-color: var(--accent); }
.filter-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.imp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.imp-dot.imp-3 { background: var(--imp-high); box-shadow: 0 0 5px rgba(239,68,68,0.45); }
.imp-dot.imp-2 { background: var(--imp-mid);  box-shadow: 0 0 4px rgba(245,158,11,0.35); }
.imp-dot.imp-1 { background: var(--imp-low); }

/* 캘린더 통계 */
.calendar-stats {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* 경제 지표 테이블 */
.econ-table-wrap { overflow-x: auto; }

.econ-table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: 10px;
  overflow: hidden;
}

.econ-table th {
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-base);
  text-align: center;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.econ-table th.num { text-align: center; }

.econ-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-primary);
  text-align: center;
}
.econ-table td.num { text-align: center; font-size: 13px; }

.econ-table tbody tr:hover { background: var(--bg-base); }
body.dark-theme .econ-table tbody tr:hover { background: rgba(255,255,255,0.03); }

.td-time { font-size: 13px; color: var(--text-secondary); white-space: nowrap; text-align: center; }
.td-indicator { font-weight: 600; text-align: left; }

.country-flag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 4px;
  white-space: nowrap;
}
.country-flag.flag-us { background: rgba(59, 130, 246, 0.15); color: #2563eb; }
.country-flag.flag-kr { background: rgba(239, 68, 68, 0.15); color: #dc2626; }
.country-flag.flag-eu { background: rgba(99, 102, 241, 0.15); color: #6366f1; }
.country-flag.flag-cn { background: rgba(220, 38, 38, 0.15); color: #dc2626; }
.country-flag.flag-jp { background: rgba(239, 68, 68, 0.10); color: #dc2626; }
.country-flag.flag-gb { background: rgba(30, 64, 175, 0.15); color: #1e40af; }
.country-flag.flag-de { background: rgba(234, 179, 8, 0.15); color: #a16207; }

.country-flag-v2 {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}
.country-flag-v2 img {
  flex-shrink: 0;
  border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

.imp-stars { display: flex; gap: 2px; align-items: center; justify-content: center; }
.imp-star {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  display: inline-block;
}
.imp-star.filled-3 { background: var(--imp-high); }
.imp-star.filled-2 { background: var(--imp-mid); }
.imp-star.filled-1 { background: var(--imp-low); }

/* 발표 예정 / 발표값 색상 */
.badge-pending { font-size: 11px; color: var(--text-muted); }
.actual-beat   { color: var(--imp-high); font-weight: 600; }
.actual-miss   { color: var(--negative); font-weight: 600; }
.actual-inline { color: var(--text-primary); }
.td-flag-name  { white-space: nowrap; }

#calendar-event-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}


.legal-error {
  text-align: center;
  color: var(--text-muted);
  padding: 32px 0;
  font-size: 14px;
}

/* =========================================
   마이페이지 토글 스위치 (JS 이벤트 연동)
   ========================================= */
.mypage-toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.mypage-toggle-track {
  width: 40px;
  height: 22px;
  border-radius: 99px;
  background: var(--border);
  position: relative;
  transition: background var(--transition);
  display: block;
}

.mypage-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform var(--transition);
}

.mypage-toggle-switch input:checked ~ .mypage-toggle-track { background: var(--accent); }
.mypage-toggle-switch input:checked ~ .mypage-toggle-track .mypage-toggle-thumb { transform: translateX(18px); }
.mypage-toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }

/* mypage-menu active 상태 (JS classList 토글) */
.mypage-menu-item:hover {
  background-color: #EFF6FF !important;
  color: #2563EB;
}
.mypage-menu-item.active {
  color: #1D4ED8 !important;
  background: #DBEAFE !important;
  border-left: 3px solid #2563EB;
  padding-left: calc(1rem - 3px) !important; /* border-left 3px 보정, Tailwind px-4 오버라이드 */
  font-weight: 600 !important;
}
body.dark-theme .mypage-menu-item:hover {
  background-color: #1E3A5F !important;
  color: #93C5FD;
}
body.dark-theme .mypage-menu-item.active {
  background: #1E3A5F !important;
  color: #93C5FD !important;
  border-left-color: #58a6ff;
}

/* mypage-theme-btn active */
.mypage-theme-btn[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-muted);
}

/* mypage-mobile-tab active */
.mypage-mobile-tab.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  font-weight: 600;
}
.mypage-mobile-tab {
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  min-height: 44px;
  padding: 10px 4px;
  font-size: 11px;
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mypage-mobile-tab:hover {
  color: var(--text-primary);
}

/* =========================================
   샘플 플랜 탭 (JS: switchSampleTab)
   ========================================= */
.sample-plan-tab.active {
  background: var(--accent) !important;
  color: #fff !important;
}

/* =========================================
   커뮤니티 탭 (JS: loadCommunityPosts active)
   ========================================= */

/* 탭바 전체: 세로 방향 row 스택 */
.community-tab-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

/* 각 탭 행 */
.community-tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* 상위 탭 행 — 하단 구분선 */
.community-tab-row-main {
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

/* 하위 탭 행 — 약간 들여쓰기 */
.community-tab-row-sub {
  padding: 4px 0 4px 8px;
}

/* 인기글 기간 하위 탭 버튼 */
.community-sub-tab {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.community-sub-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-muted);
}
.community-sub-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
body.dark-theme .community-sub-tab {
  background: #0d1117;
  border-color: #30363d;
}
body.dark-theme .community-sub-tab:hover {
  border-color: var(--accent);
  background: var(--accent-muted);
  color: var(--accent);
}

.community-tab {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.community-tab:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-muted);
}
.community-tab.active {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}

/* 섹터별/기업별 더보기 버튼 -- 점선 구분 스타일 */
.community-tab-more {
  background: transparent !important;
  border: 1px dashed var(--border) !important;
  color: var(--text-muted) !important;
  font-weight: 500;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
}
.community-tab-more:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  background: var(--accent-muted) !important;
}

/* 섹터/기업 탭 숨김 컨테이너 -- flex-wrap 그리드형 */
.community-tabs-hidden {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  padding: 10px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
}
body.dark-theme .community-tabs-hidden {
  background: #161b22;
  border-color: #30363d;
}
/* community-tabs-hidden 내부 탭 버튼 명시적 스타일 */
.community-tabs-hidden .community-tab {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.community-tabs-hidden .community-tab:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-muted);
}
.community-tabs-hidden .community-tab.active {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}

/* 커뮤니티 빈 상태 */
.community-empty-state {
  display: none;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  text-align: center;
  color: var(--text-muted);
}
.community-empty-state .empty-state-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}
.community-empty-state .empty-state-desc {
  font-size: 13px;
}

/* HOT 탭 빈 목록 안내 (tbody tr > td) */
.empty-state-hot {
  padding: 40px 20px;
  text-align: center;
}
.empty-state-hot .empty-state-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.empty-state-hot .empty-state-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* 기업 목록 컨테이너 */
.comm-company-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 160px;
  overflow-y: auto;
  padding: 8px 0;
}
.comm-company-tab {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.comm-company-tab:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-muted);
}
.company-board-search {
  margin-bottom: 8px;
}
.comm-company-search {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--bg-card);
  color: var(--text-primary);
}
body.dark-theme .comm-company-search {
  background: #0d1117;
  color: #e6edf3;
  border-color: #30363d;
}

/* =========================================
   게시글 상세 뷰 (JS: renderPostDetail)
   ========================================= */
.post-detail-view {
  padding: 20px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
}
body.dark-theme .post-detail-view {
  background: #161b22;
  border-color: #30363d;
}
.post-detail-header {
  margin-bottom: 16px;
}
.post-back-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-base);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}
.post-back-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.post-detail-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.post-detail-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.post-detail-content {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-primary);
  min-height: 100px;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.post-detail-comments {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.post-detail-comments h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}
.comment-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.comment-item:last-child {
  border-bottom: none;
}
.comment-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.comment-content {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* =========================================
   게시글 투표 바 (JS: _handlePostVote)
   ========================================= */
.post-vote-bar {
  display: flex;
  gap: 20px;
  margin: 32px 0 24px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  justify-content: center;
}

.btn-vote {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 96px;
  padding: 14px 24px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.btn-vote .vote-icon {
  font-size: 20px;
  line-height: 1;
}

.btn-vote .vote-label {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-vote .vote-count {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-vote:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--accent-muted);
  box-shadow: var(--shadow);
}
.btn-vote:hover:not(:disabled) .vote-icon,
.btn-vote:hover:not(:disabled) .vote-count {
  color: var(--accent);
}

.btn-vote.active {
  border-color: var(--accent);
  background: var(--accent-muted);
  box-shadow: var(--shadow);
}
.btn-vote.active .vote-icon,
.btn-vote.active .vote-count {
  color: var(--accent);
}

.btn-vote:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

body.dark-theme .btn-vote {
  background: #161b22;
  border-color: #30363d;
}
body.dark-theme .btn-vote .vote-count {
  color: var(--text-primary);
}
body.dark-theme .btn-vote:hover:not(:disabled),
body.dark-theme .btn-vote.active {
  border-color: var(--accent);
  background: var(--accent-muted);
}

@media (max-width: 640px) {
  .post-vote-bar {
    gap: 12px;
    padding: 16px 0;
    margin: 20px 0 16px;
  }
  .btn-vote {
    min-width: 80px;
    padding: 10px 16px;
  }
  .btn-vote .vote-icon {
    font-size: 18px;
  }
  .btn-vote .vote-label {
    font-size: 10px;
  }
  .btn-vote .vote-count {
    font-size: 14px;
  }

  /* 커뮤니티 목록 테이블 — 모바일 컬럼 숨김 + overflow 방지 */
  .comm-list-wrap,
  #page-community {
    max-width: 100%;
    overflow-x: hidden;
  }

  .comm-table {
    table-layout: fixed;
    width: 100%;
    max-width: 100%;
  }

  .comm-table .col-num,
  .comm-table .col-category,
  .comm-table .col-author,
  .comm-table .col-views {
    display: none;
  }
  .comm-table .col-title {
    width: auto;
  }
  .comm-table .col-date {
    width: 76px;
    min-width: 0;
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    padding-left: 4px;
    padding-right: 4px;
  }
  .comm-table .col-likes {
    width: 40px;
    min-width: 0;
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
    padding-left: 4px;
    padding-right: 4px;
  }
  .comm-table th,
  .comm-table td {
    padding: 10px 6px;
    font-size: 13px;
  }
  .comm-table .post-title-text {
    display: block;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  /* 커뮤니티 탭 바 — 모바일 wrap 간격 보강 */
  .community-tab-bar {
    gap: 6px;
  }
  .community-tab-row {
    row-gap: 6px;
    gap: 6px;
  }
  .community-tab,
  .community-tab-more {
    padding: 7px 12px;
    font-size: 12px;
  }
  .community-sub-tab {
    padding: 5px 12px;
    font-size: 11px;
  }

  /* 게시글 목록 행 터치 영역 강화 */
  .comm-table tbody tr {
    cursor: pointer;
  }
  .comm-table tbody tr:active {
    background: var(--accent-muted);
  }
}

@media (max-width: 400px) {
  .btn-vote {
    min-width: 72px;
    padding: 9px 12px;
  }
  .auth-modal-box {
    padding: 22px 20px 18px;
  }
  .auth-modal-title {
    font-size: 16px;
  }
}

/* =========================================
   댓글 작성 폼 (JS: _handleCommentSubmit)
   ========================================= */
.comment-form-section {
  margin-bottom: 20px;
}

.comment-form textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  transition: border-color var(--transition);
  display: block;
}
.comment-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
body.dark-theme .comment-form textarea {
  background: #0d1117;
  border-color: #30363d;
}

.comment-form-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.comment-anon-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.comment-char-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
}

.btn-comment-submit {
  padding: 7px 18px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
  white-space: nowrap;
}
.btn-comment-submit:hover:not(:disabled) {
  background: var(--accent-hover);
}
.btn-comment-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.comment-login-prompt {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-base);
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 20px;
}
.comment-login-prompt a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
}

/* =========================================
   댓글 항목 헤더 + 액션 바 (JS: _buildSingleCommentHtml)
   ========================================= */
.comment-item-header {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 6px;
}

.comment-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.comment-date {
  font-size: 12px;
  color: var(--text-muted);
}

.comment-item-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.btn-comment-vote {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-comment-vote:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-comment-vote.active {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}
.btn-comment-vote:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-comment-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 3px 6px;
  margin-left: 4px;
  transition: color var(--transition);
}
.btn-comment-delete:hover {
  color: var(--imp-high);
  text-decoration: underline;
}

/* 댓글 신고 버튼 */
.btn-comment-report {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 3px 6px;
  margin-left: 4px;
  transition: color var(--transition);
}
.btn-comment-report:hover {
  color: var(--text-secondary);
  text-decoration: underline;
}

/* 게시글 수정/삭제/신고 버튼 래퍼 */
.post-action-btns {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}

/* 게시글 액션 버튼 공통 */
.post-action-btn {
  background: none;
  border: none;
  font-size: 12px;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
  color: var(--text-muted);
}
.post-edit-btn:hover {
  color: var(--accent);
  background: var(--bg-hover, rgba(0,0,0,0.05));
}
.post-delete-btn {
  color: var(--text-muted);
}
.post-delete-btn:hover {
  color: var(--imp-high);
  background: var(--bg-hover, rgba(0,0,0,0.05));
}
.post-report-btn:hover {
  color: var(--text-secondary);
  background: var(--bg-hover, rgba(0,0,0,0.05));
}

.comment-deleted {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  padding: 4px 0;
}
/* =========================================
   대댓글 (reply) 스타일
   ========================================= */
.comment-reply {
  margin-left: 28px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
  margin-top: 8px;
}
body.dark-theme .comment-reply {
  border-left-color: #30363d;
}

.btn-comment-reply {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  padding: 2px 4px;
  transition: color var(--transition);
}
.btn-comment-reply:hover {
  color: var(--accent);
}

.comment-reply-form {
  margin-top: 10px;
  padding: 10px;
  background: var(--bg-base);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.comment-reply-form textarea {
  width: 100%;
  min-height: 50px;
  font-size: 13px;
}

.btn-reply-submit {
  padding: 6px 14px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
  white-space: nowrap;
}
.btn-reply-submit:hover:not(:disabled) {
  background: var(--accent-hover);
}
.btn-reply-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-reply-cancel {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.btn-reply-cancel:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}



.comment-empty {
  font-size: 14px;
  color: var(--text-muted);
  padding: 8px 0;
}

/* =========================================
   auth-msg (로그인/회원가입 에러 메시지)
   ========================================= */
.auth-msg {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
}
.auth-msg.error  { background: rgba(239, 68, 68, 0.10); color: #dc2626; }
.auth-msg.success { background: rgba(16, 185, 129, 0.10); color: #059669; }

/* mypage-msg */
.mypage-msg {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  text-align: center;
}
.mypage-msg.error,
.mypage-msg.mypage-msg-error   { background: rgba(239, 68, 68, 0.10); color: #dc2626; }
.mypage-msg.success,
.mypage-msg.mypage-msg-success { background: rgba(16, 185, 129, 0.10); color: #059669; }

/* =========================================
   소셜 로그인 버튼 (JS가 클릭 이벤트 바인딩)
   ========================================= */
.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
}

.btn-google {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-google:hover { background: var(--bg-base); }
body.dark-theme .btn-google { background: #21262d; color: #e6edf3; border-color: #30363d; }
body.dark-theme .btn-google:hover { background: #2d333b; }

.btn-kakao {
  background: #fee500;
  color: #3c1e1e;
}
.btn-kakao:hover { background: #fada00; }

.btn-naver {
  background: #03c75a;
  color: #fff;
}
.btn-naver:hover { background: #02b34f; }

/* =========================================
   첨부파일 미리보기 (JS 동적 생성)
   ========================================= */
.comm-attach-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 12px;
  color: var(--text-secondary);
}

.comm-attach-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 12px;
}
.comm-attach-remove:hover { color: var(--positive); }

/* =========================================
   티커 테이프 (ticker-track, JS 동적 생성)
   ========================================= */
.ticker-track {
  display: flex;
  white-space: nowrap;
  animation: ticker-scroll 60s linear infinite;
  height: 100%;
  align-items: center;
}

.ticker-track:hover { animation-play-state: paused; }

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 100%;
  font-size: 12px;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}

.ticker-name  { font-weight: 600; color: var(--text-primary); }
.ticker-price { color: var(--text-primary); font-family: var(--font-mono); }
.ticker-change { font-weight: 500; font-family: var(--font-mono); }
.ticker-change.positive { color: var(--positive); }
.ticker-change.negative { color: var(--negative); }

/* =========================================
   섹터 칩 (JS: renderSectorChips)
   ========================================= */
.sector-chip {
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}
.sector-chip:hover { color: var(--accent); border-color: var(--accent); }
.sector-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* trending 관련 */
.trending-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.trending-item:last-child { border-bottom: none; }

.trending-rank { font-size: 12px; font-weight: 700; color: var(--text-muted); width: 18px; text-align: center; flex-shrink: 0; }
.trending-rank.top3 { color: var(--positive); }

.trending-name { flex: 1; font-weight: 500; color: var(--text-primary); }
.trending-code { color: var(--text-muted); font-size: 11px; }

.trending-price  { font-family: var(--font-mono); font-size: 12px; color: var(--text-primary); }
.trending-change { font-family: var(--font-mono); font-size: 11px; font-weight: 500; }
.trending-change.positive { color: var(--positive); }
.trending-change.negative { color: var(--negative); }

/* =========================================
   캘린더 최신 뉴스 목록 (JS: loadLatestNews)
   ========================================= */
.news-link-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  font-size: 13px;
  transition: color var(--transition);
}
.news-link-item:last-child { border-bottom: none; }
.news-link-item:hover { color: var(--accent); }

.news-time   { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); flex-shrink: 0; }
.news-source { font-size: 11px; color: var(--accent); font-weight: 600; flex-shrink: 0; }
.news-title  { font-size: 13px; font-weight: 500; flex: 1; }

/* =========================================
   캐러셀 (JS: buildCarousel)
   ========================================= */
.carousel-wrap {
  position: relative;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-page {
  display: grid;
  min-width: 100%;
  gap: 16px;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.carousel-dot.active { background: var(--accent); }

.carousel-prev, .carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all var(--transition);
  font-size: 13px;
  color: var(--text-secondary);
}
.carousel-prev:hover, .carousel-next:hover { color: var(--accent); border-color: var(--accent); }
.carousel-prev { left: -16px; }
.carousel-next { right: -16px; }

/* 메인 차트 카드 */
.main-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.main-chart-card:hover { box-shadow: var(--shadow); }

.main-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}

.main-chart-info { display: flex; flex-direction: column; gap: 2px; }
.main-chart-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.main-chart-desc { font-size: 11px; color: var(--text-muted); }

.main-chart-right { display: flex; align-items: center; gap: 12px; }

.chart-period-group { display: flex; gap: 4px; }

.chart-period-btn {
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.chart-period-btn:hover { color: var(--accent); border-color: var(--accent); }
.chart-period-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.main-chart-price-wrap { text-align: right; }
.main-chart-price { font-size: 15px; font-weight: 700; font-family: var(--font-mono); color: var(--text-primary); display: block; }
.main-chart-change { font-size: 12px; font-family: var(--font-mono); }
.main-chart-change.positive { color: var(--positive); }
.main-chart-change.negative { color: var(--negative); }

.main-chart-area { height: 200px; }

/* 미니 차트 */
.mini-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

/* =========================================
   마켓 탭 / 패널 (JS: market-tab, market-panel)
   ========================================= */
.market-tab {
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.market-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.market-panel { display: none; }
.market-panel.active { display: block; }

/* 기간 선택 버튼 */
.period-btn {
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.period-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 차트 모드 탭 */
.chart-mode-tab {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.chart-mode-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* =========================================
   반응형
   ========================================= */
@media (max-width: 768px) {
  .mypage-wrap { flex-direction: column; }
  .mypage-sidebar { display: none !important; }

  /* col-likes는 640px 블록에서 표시(width:40px)하므로 여기서는 제외 */
  .comm-table .col-num,
  .comm-table .col-views { display: none; }

  .econ-table .td-time { font-size: 10px; }
}

/* =========================================
   포털형 2단 레이아웃 (메인 페이지 #page-market)
   ========================================= */
.portal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1023px) {
  .portal-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .portal-sidebar {
    display: none;
  }
}

/* 포털 섹션 */
.portal-section {
  background: linear-gradient(180deg, var(--bg-card) 0%, #f8fafc 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.portal-section:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
body.dark-theme .portal-section {
  background: linear-gradient(180deg, var(--bg-card) 0%, #1a1f27 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.20);
}
body.dark-theme .portal-section:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.portal-section:last-child {
  margin-bottom: 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  display: flex;
  align-items: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.section-icon {
  display: inline-block;
  vertical-align: -3px;
  margin-right: 7px;
  color: var(--accent);
  flex-shrink: 0;
}

.section-more {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition), gap var(--transition);
}
.section-more:hover {
  color: var(--accent);
  gap: 6px;
}
.section-more::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--transition);
  flex-shrink: 0;
}
.section-more:hover::after {
  transform: rotate(-45deg) translateX(2px);
}

/* 포털 사이드바 */
.portal-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 16px);
}

.sidebar-widget {
  background: linear-gradient(180deg, var(--bg-card) 0%, #f8fafc 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.sidebar-widget:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}
body.dark-theme .sidebar-widget {
  background: linear-gradient(180deg, var(--bg-card) 0%, #1a1f27 100%);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}
body.dark-theme .sidebar-widget:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.30);
}

.sidebar-widget:last-child {
  margin-bottom: 0;
}

.sidebar-widget-title {
  display: flex;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}

/* 사이드바 위젯 더보기 링크 */
.widget-more {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  flex-shrink: 0;
}
.widget-more:hover { color: var(--accent); }

/* 이슈 랭킹 리스트 */
.issue-ranking-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  cursor: pointer;
  transition: color var(--transition), transform var(--transition);
  border-bottom: 1px solid var(--border);
}
.issue-ranking-item:last-child { border-bottom: none; }
.issue-ranking-item:hover { color: var(--accent); transform: translateX(3px); }

.ranking-number {
  font-size: 14px;
  font-weight: 800;
  width: 20px;
  text-align: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.ranking-number.top3 { color: #ff6b00; }
body.dark-theme .ranking-number.top3 { color: #f59e0b; }

.ranking-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ranking-title {
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}
.ranking-count {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* 이슈 랭킹 바 그래프 */
.ranking-bar {
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.25;
  min-width: 16px;
  transition: opacity 0.2s ease;
}
.ranking-bar.bar-top1 { opacity: 1.0; }
.ranking-bar.bar-top2 { opacity: 0.6; }
.ranking-bar.bar-top3 { opacity: 0.4; }
.issue-ranking-item:hover .ranking-bar { opacity: 1; }

/* 미니 캘린더 이벤트 */
.mini-cal-event {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.mini-cal-event:last-child { border-bottom: none; }

.mini-cal-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 사이드바 로그인 위젯 */
.sidebar-login-prompt {
  text-align: center;
  padding: 4px 0;
}
.sidebar-login-prompt p {
  margin-bottom: 12px;
}

/* Hero + 리스트 하이브리드 (네이버 뉴스 패턴) */
.news-hybrid-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 639px) {
  .news-hybrid-grid {
    grid-template-columns: 1fr;
  }
}

/* Hero 카드: 좌측 컬럼 강조 영역 */
.news-hero {
  background: linear-gradient(135deg, var(--accent-muted) 0%, transparent 60%);
  border-radius: 12px;
  padding: 20px;
  border-left: 4px solid var(--accent);
  height: 100%;
}

.news-hero-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 8px;
}
.news-hero-title a { color: inherit; transition: color var(--transition); }
.news-hero-title a:hover { color: var(--accent); }

.news-hero-summary {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.news-hero-ai {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ai-color);
  background: var(--ai-bg);
  border-radius: 6px;
  padding: 6px 10px;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

/* 뉴스 리스트 (우측 텍스트 열) */
.news-list-col {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.news-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-primary);
  font-size: 13px;
  transition: color var(--transition), background var(--transition);
}
.news-list-item:last-child { border-bottom: none; }
.news-list-item:hover {
  color: var(--accent);
  background: var(--bg-base);
}

.news-list-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.news-list-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

/* ---- 스크롤 진입 애니메이션 ---- */
.animate-ready {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* ---- 사이드바 구독 CTA 버튼 ---- */
.sidebar-cta-btn {
  display: block;
  text-align: center;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  margin-top: 12px;
}
.sidebar-cta-btn:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

/* =========================================
   v17.2 포털형 리디자인 — 페이지별 개선
   ========================================= */

/* ---- 캘린더 페이지 포털형 ---- */
.cal-grid-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
body.dark-theme .cal-grid-card {
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* 달력 셀 오늘 날짜 강조 */
.cal-cell.cal-today .cal-day-num {
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}
.cal-cell:hover {
  background: var(--accent-muted);
}

/* 이벤트 카운트 배지 */
.cal-evt-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ---- 커뮤니티 페이지 포털형 ---- */
.comm-list-wrap {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
body.dark-theme .comm-list-wrap {
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

#community-hot-section {
  background: linear-gradient(135deg, rgba(37,99,235,0.05) 0%, rgba(124,58,237,0.03) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
}
body.dark-theme #community-hot-section {
  background: linear-gradient(135deg, rgba(88,166,255,0.05) 0%, rgba(167,139,250,0.03) 100%);
}

.community-tab {
  border-radius: 20px !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
}
.community-tab.active {
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25) !important;
}
body.dark-theme .community-tab.active {
  box-shadow: 0 2px 4px rgba(88, 166, 255, 0.25) !important;
}

/* ---- 구독 페이지 ---- */
.subscribe-card-portal {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
body.dark-theme .subscribe-card-portal {
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

/* ---- 인증 페이지 (로그인/회원가입) ---- */
.auth-card {
  border-radius: 20px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08) !important;
  border: 1px solid var(--border) !important;
}
body.dark-theme .auth-card {
  box-shadow: 0 8px 32px rgba(0,0,0,0.3) !important;
}

.auth-submit {
  border-radius: 12px !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
  transition: all 0.2s ease !important;
}
.auth-submit:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4) !important;
}

/* ---- 마이페이지 ---- */
.mypage-sidebar .mypage-menu {
  border-radius: 16px !important;
  overflow: hidden;
}
.mypage-sidebar .mypage-user-brief {
  border-radius: 16px !important;
}
.mypage-panel {
  border-radius: 16px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
}
body.dark-theme .mypage-panel {
  box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
}

/* ---- 날짜 ago 텍스트 ---- */
.time-ago {
  color: var(--text-muted);
  font-size: 10px;
  margin-left: 3px;
}
.news-item-time .time-ago {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
}

/* =========================================
   피드 검색바 (JS 동적 생성 — feed-search-wrap)
   ========================================= */
.feed-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.feed-search-input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 14px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.feed-search-input::placeholder {
  color: var(--text-muted);
}
.feed-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}
body.dark-theme .feed-search-input {
  background: #1c2128;
  border-color: #30363d;
  color: var(--text-primary);
}
body.dark-theme .feed-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.12);
}

.feed-search-btn {
  flex-shrink: 0;
  height: 38px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.feed-search-btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.feed-search-btn:active {
  transform: translateY(1px);
}

.feed-search-clear {
  flex-shrink: 0;
  height: 38px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font);
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  white-space: nowrap;
}
.feed-search-clear:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-muted);
}
body.dark-theme .feed-search-clear {
  background: #1c2128;
  border-color: #30363d;
}

/* 검색 활성 상태 — 검색 영역 강조 */
.feed-search-wrap.feed-search-active .feed-search-input {
  border-color: var(--accent);
}

/* 검색 결과 헤더 배너 */
.search-result-header {
  padding: 10px 14px;
  background: var(--accent-muted);
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
body.dark-theme .search-result-header {
  background: rgba(88, 166, 255, 0.08);
  border-color: rgba(88, 166, 255, 0.18);
}
.search-result-query {
  font-weight: 700;
  color: var(--accent);
}

@media (max-width: 639px) {
  .feed-search-wrap { gap: 6px; }
  .feed-search-btn  { padding: 0 12px; }
  .feed-search-clear { padding: 0 10px; }
}

/* ---- news-item-time: 481행 정의에 통합됨 ---- */
.feed-active-sector-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  padding: 12px 0 4px;
}

/* =========================================
   이슈 탭 더보기 (JS 동적 생성)
   ========================================= */
.issue-tabs-hidden {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.issue-tab-more {
  background: transparent !important;
  border: 1px dashed var(--border) !important;
  color: var(--text-muted) !important;
  font-weight: 500 !important;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.issue-tab-more:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  background: var(--accent-muted) !important;
}

/* AI 브리핑 구독 샘플 위젯 */
.ai-briefing-sample { display: flex; gap: 8px; margin-top: 8px; }
.ai-sample-card { flex: 1; padding: 10px; border-radius: 8px; background: var(--bg-card); border: 1px solid var(--border); font-size: 12px; }
.ai-sample-label { font-weight: 700; color: var(--accent); margin-bottom: 6px; font-size: 13px; }
.ai-sample-card ul { margin: 0; padding: 0 0 0 16px; }
.ai-sample-card li { margin: 3px 0; color: var(--text-secondary); line-height: 1.5; }
body.dark-theme .ai-sample-card { background: var(--bg-base); }

/* =========================================
   로그인 유도 모달 (auth modal)
   ========================================= */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: authModalFade 0.18s ease;
  padding: 16px;
}

@keyframes authModalFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.auth-modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 28px 20px;
  max-width: 360px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: authModalPop 0.2s ease;
}

@keyframes authModalPop {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.auth-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.auth-modal-msg {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 22px;
}

.auth-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-auth-modal-cancel,
.btn-auth-modal-login {
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid var(--border);
}

.btn-auth-modal-cancel {
  background: var(--bg-base);
  color: var(--text-secondary);
}
.btn-auth-modal-cancel:hover { background: var(--border); }

.btn-auth-modal-login {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-auth-modal-login:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

body.dark-theme .auth-modal-box {
  background: #161b22;
  border-color: #30363d;
}

/* =========================================
   마이페이지 섹터 그리드 (C3 수정)
   ========================================= */
.mypage-sector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.mypage-sector-grid label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-base);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mypage-sector-grid label:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.mypage-sector-grid input[type="checkbox"] {
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}
.mypage-sector-grid label:has(input:checked) {
  border-color: var(--accent);
  background: rgba(88, 166, 255, 0.08);
  color: var(--accent);
  font-weight: 600;
}
.mypage-sector-grid label:has(input:disabled) {
  opacity: 0.45;
  cursor: not-allowed;
}

body.dark-theme .mypage-sector-grid label {
  background: #0d1117;
  border-color: #30363d;
}
body.dark-theme .mypage-sector-grid label:has(input:checked) {
  background: rgba(88, 166, 255, 0.12);
}

@media (max-width: 640px) {
  .mypage-sector-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .mypage-sector-grid label {
    font-size: 12px;
    padding: 7px 10px;
  }

  /* 푸터 링크 터치 타겟 확대 (WCAG 2.1 권장 44px) */
  .footer-nav-link,
  .footer-biz-link {
    padding-top: 10px;
    padding-bottom: 10px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }
}

/* =========================================
   LEGAL CONTENT (이용약관, 개인정보처리방침)
   markdownToHtml로 .legal-content에 동적 삽입되는 콘텐츠
   ========================================= */
.legal-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px 64px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-primary, #1f2937);
  word-break: keep-all;
  overflow-wrap: break-word;
}
.legal-content > *:first-child {
  margin-top: 0;
}
.legal-content h1 {
  font-size: 22px;
  font-weight: 700;
  margin-top: 36px;
  margin-bottom: 16px;
  line-height: 1.4;
  color: var(--text-primary, #111827);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.legal-content h2 {
  font-size: 18px;
  font-weight: 700;
  margin-top: 32px;
  margin-bottom: 12px;
  line-height: 1.45;
  color: var(--text-primary, #111827);
}
.legal-content h3 {
  font-size: 16px;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 10px;
  line-height: 1.5;
  color: var(--text-primary, #1f2937);
}
.legal-content p {
  margin: 0 0 14px;
  line-height: 1.75;
  color: var(--text-secondary, #4b5563);
}
.legal-content ul,
.legal-content ol {
  margin: 0 0 16px;
  padding-left: 22px;
}
.legal-content li {
  margin-bottom: 8px;
  line-height: 1.7;
  color: var(--text-secondary, #4b5563);
}
.legal-content li > ul,
.legal-content li > ol {
  margin-top: 8px;
  margin-bottom: 4px;
}
.legal-content strong,
.legal-content b {
  color: var(--text-primary, #111827);
  font-weight: 600;
}
.legal-content a {
  color: var(--accent, #2563eb);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal-content a:hover {
  text-decoration: none;
}
.legal-content blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  border-left: 3px solid var(--accent, #2563eb);
  background: var(--bg-card, #f9fafb);
  color: var(--text-secondary, #4b5563);
  border-radius: 0 6px 6px 0;
}
.legal-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  padding: 2px 6px;
  background: var(--bg-card, #f3f4f6);
  border-radius: 4px;
}
.legal-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
  display: block;
  overflow-x: auto;
}
.legal-content table th,
.legal-content table td {
  padding: 10px 12px;
  border: 1px solid var(--border, #e5e7eb);
  text-align: left;
  vertical-align: top;
  line-height: 1.6;
}
.legal-content table th {
  background: var(--bg-card, #f9fafb);
  font-weight: 600;
  color: var(--text-primary, #111827);
}
.legal-content hr {
  border: none;
  border-top: 1px solid var(--border, #e5e7eb);
  margin: 28px 0;
}

/* 데스크톱 (>=768px) — 폰트 약간 키움 */
@media (min-width: 768px) {
  .legal-content {
    padding: 32px 24px 80px;
    font-size: 16px;
  }
  .legal-content h1 { font-size: 26px; margin-top: 0; }
  .legal-content h2 { font-size: 20px; margin-top: 36px; }
  .legal-content h3 { font-size: 17px; margin-top: 28px; }
}

/* 다크 테마 */
body.dark-theme .legal-content {
  color: var(--text-primary);
}
body.dark-theme .legal-content h1,
body.dark-theme .legal-content h2,
body.dark-theme .legal-content h3,
body.dark-theme .legal-content strong,
body.dark-theme .legal-content b,
body.dark-theme .legal-content table th {
  color: var(--text-primary);
}
body.dark-theme .legal-content p,
body.dark-theme .legal-content li {
  color: var(--text-secondary);
}
body.dark-theme .legal-content blockquote {
  background: var(--bg-card);
}
body.dark-theme .legal-content table th {
  background: var(--bg-card);
}
body.dark-theme .legal-content table th,
body.dark-theme .legal-content table td {
  border-color: var(--border);
}

/* =========================================
   UX 개선 (v18.11) — 색상 대비 + 버튼 피드백
   ========================================= */

/* 일반 버튼 hover: 미세 상승 + 그림자 피드백
   (auth-submit, sidebar-cta-btn 등 이미 transform 있는 버튼은 제외)
   specificity 낮게 유지해서 개별 버튼 스타일과 충돌 없도록 */
.btn-subscribe:hover,
.btn-auth-text:hover,
.page-nav-btn:hover,
.page-size-btn:hover:not(.active),
.comm-page-btn:hover:not([disabled]):not(.active),
.cal-nav-btn:hover,
.cal-back-btn:hover,
.date-nav-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* 다크 모드 텍스트 대비 보강 */
/* 구독 페이지: 카드 내 텍스트 */
body.dark-theme .subscribe-card-portal p,
body.dark-theme .subscribe-card-portal li,
body.dark-theme .subscribe-card-portal span:not([class*="text-"]) {
  color: var(--text-secondary);
}

/* 마이페이지: 필드 라벨 (Tailwind text-gray-600이 다크에서 어두움) */
body.dark-theme label,
body.dark-theme .mypage-label,
body.dark-theme .mypage-field-label {
  color: var(--text-secondary);
}

/* 커뮤니티 글 내용 */
body.dark-theme .post-detail-content,
body.dark-theme .post-title-text,
body.dark-theme .comm-table td {
  color: var(--text-primary);
}

/* footer 텍스트 */
body.dark-theme footer,
body.dark-theme .site-footer,
body.dark-theme #site-footer {
  color: var(--text-secondary);
}
body.dark-theme footer a,
body.dark-theme .site-footer a {
  color: var(--text-muted);
}
body.dark-theme footer a:hover,
body.dark-theme .site-footer a:hover {
  color: var(--text-secondary);
}

/* 커뮤니티 탭 바 — 왼쪽 정렬 명시 (현재 flex 구조에서 자동이지만 명시로 의도 고정) */
.community-tab-bar {
  align-items: flex-start;
}
.community-tab-row {
  justify-content: flex-start;
}

/* ================================================
   수신 이메일 설정 + Pro 배너 (v19.3)
   ================================================ */
.delivery-email-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 4px;
}
.delivery-email-wrap input {
  flex: 1;
  min-width: 220px;
}

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  margin-left: 4px;
  vertical-align: middle;
}
.badge-success { background: #d4edda; color: #155724; }
.badge-warn    { background: #fff3cd; color: #856404; }
.badge-info    { background: #e2e3e5; color: #383d41; }
body.dark-theme .badge-success { background: #1a3a25; color: #6fcf97; }
body.dark-theme .badge-warn    { background: #3a2e00; color: #f4c842; }
body.dark-theme .badge-info    { background: #2a2d31; color: #adb5bd; }

.banner-warn {
  background: #fff3cd;
  border: 1px solid #ffc107;
  padding: 12px 16px;
  margin: 8px 0;
  border-radius: 6px;
}
.banner-warn strong {
  color: #856404;
  font-size: 14px;
}
.banner-warn p {
  color: #664d03;
  margin: 0;
}
.banner-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
body.dark-theme .banner-warn {
  background: #3a2e00;
  border-color: #b38600;
}
body.dark-theme .banner-warn strong { color: #f4c842; }
body.dark-theme .banner-warn p      { color: #dbb84a; }

@media (max-width: 640px) {
  .delivery-email-wrap {
    flex-direction: column;
    align-items: stretch;
  }
  .delivery-email-wrap input {
    width: 100%;
    min-width: auto;
  }
  .status-badge {
    margin-left: 0;
    align-self: flex-start;
  }
}
