/* 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: '☽'; }
/* 탭 타겟 최소 32px (WCAG 2.1 AA, touch target) */
#btn-theme-toggle { min-width: 32px; }

/* =========================================
   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: 11px;
  padding: 2px 6px;
}

/* #14 fix: overflow: hidden 추가.
   .news-item-ai(.ai-text white-space:nowrap)가 우측 .news-item-meta(날짜)와
   겹치는 현상은 flex child의 overflow 경계 미지정 때문.
   min-width: 0만으로는 내부 nowrap 콘텐츠가 경계를 넘을 수 있으므로
   overflow: hidden으로 경계를 확정한다. */
.news-item-content { flex: 1; min-width: 0; overflow: hidden; }

.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: 11px;
  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;
  min-width: 72px;
  max-width: 110px;
}
.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);
}

/* =========================================
   ISSUE 내부 탭 바 (뉴스/커뮤니티 내부 탭 — JS 동적 생성)
   ========================================= */
.issue-inner-tab-bar {
  display: flex;
  gap: 4px;
  padding: 8px 0 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.issue-inner-tab {
  padding: 5px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition), background var(--transition);
  position: relative;
  font-family: var(--font);
}
.issue-inner-tab:hover {
  color: var(--accent);
  background: var(--accent-muted);
}
.issue-inner-tab.active {
  color: var(--accent);
  font-weight: 700;
  background: var(--accent-muted);
}
.issue-inner-tab.active::after {
  content: '';
  display: block;
  position: absolute;
  bottom: -5px;
  left: 8px;
  right: 8px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}
body.dark-theme .issue-inner-tab.active {
  color: var(--accent);
  background: var(--accent-muted);
}

/* =========================================
   ISSUE 커뮤니티 게시글 아이템 (JS 동적 생성 — issue-post-item)
   .issue-post-item 은 .news-item 과 동일 베이스 레이아웃에 커뮤니티 전용 스타일 추가
   ========================================= */
.issue-post-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background var(--transition);
  cursor: pointer;
}
.issue-post-item:last-child {
  border-bottom: none;
}
.issue-post-item:hover {
  background: var(--accent-muted);
}
.issue-post-item .news-item-content {
  flex: 1;
  min-width: 0;
}
.issue-post-item .news-item-header {
  margin-bottom: 2px;
}
.issue-post-item .news-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.issue-post-item .news-item-meta {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: auto;
  min-width: 0;
  flex-wrap: wrap;
}
.issue-post-item .news-item-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* 게시글 작성자 이름 */
.post-author {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

/* 게시글 통계 (조회/추천/댓글) */
.post-stats {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.post-stat {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.post-stat::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border);
}
.post-stats .post-stat:first-child::before {
  display: none;
}

/* 다크 모드 */
body.dark-theme .issue-post-item:hover {
  background: var(--accent-muted);
}
body.dark-theme .post-stat {
  color: var(--text-muted);
}

/* 반응형 — 모바일 639px 이하 */
@media (max-width: 639px) {
  .issue-inner-tab-bar {
    gap: 2px;
    padding: 6px 0 4px;
  }
  .issue-inner-tab {
    padding: 5px 12px;
    font-size: 12px;
  }
  .issue-post-item .news-item-title {
    font-size: 13px;
  }
  .post-author {
    max-width: 64px;
  }
  .post-stats {
    gap: 6px;
  }
  .post-stat {
    font-size: 10px;
  }
}

/* 공시 출처 뱃지 (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-thumb, .col-category, .col-author, .col-date, .col-views, .col-likes, .col-down { 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; }

/* comm-hot-item — 제거됨 (v20260820: best-widget 로 교체) */

.comm-hot-notice {
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 10px;
  margin-bottom: 8px;
  background: var(--accent-muted);
  border-radius: 6px;
}

/* 커뮤니티 목록 썸네일 */
.comm-thumb {
  display: block;
  width: 56px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-base);
}
.comm-thumb-empty {
  display: block;
  width: 56px;
  height: 42px;
  border-radius: 6px;
  background: var(--bg-base);
  border: 1px solid var(--border);
}
/* 커뮤니티 제목 인라인 댓글수 */
.comm-cnt {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  margin-left: 3px;
}
/* 커뮤니티 인기 제목 강조 (추천 >= COMMUNITY_HOT_TITLE_MIN) */
.comm-title-hot {
  color: var(--positive);
  font-weight: 700;
}
body.dark-theme .comm-title-hot {
  color: var(--positive);
}
/* 반대 수 표시 */
.post-likes-down {
  color: var(--text-muted);
  font-weight: 600;
}

.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;
}

.hot-post-mode-note {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0 0 6px 2px;
  font-weight: 500;
}

.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: 11px;
  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;
}

/* -------------------------------------------------------
   #comm-sector-tabs -- 가로 스크롤 단일 행 (W1b)
   .community-tabs-hidden 공유 클래스는 wrap 유지하되
   id 선택자(specificity 우위)로 sector 전용 override.
   #comm-company-tabs 에는 미적용 (검색창 세로 구조 보존).
   ------------------------------------------------------- */
#comm-sector-tabs.community-tabs-hidden {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  max-height: none;
  padding: 10px 10px 8px;
  -webkit-overflow-scrolling: touch;
  /* 슬림 스크롤바 -- Firefox */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
body.dark-theme #comm-sector-tabs.community-tabs-hidden {
  scrollbar-color: #30363d transparent;
}
/* Webkit 슬림 스크롤바 */
#comm-sector-tabs.community-tabs-hidden::-webkit-scrollbar {
  height: 5px;
}
#comm-sector-tabs.community-tabs-hidden::-webkit-scrollbar-track {
  background: transparent;
}
#comm-sector-tabs.community-tabs-hidden::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
body.dark-theme #comm-sector-tabs.community-tabs-hidden::-webkit-scrollbar-thumb {
  background: #30363d;
}
/* sector 탭 버튼 -- 줄바꿈 금지 + 고정 폭 */
#comm-sector-tabs.community-tabs-hidden .community-tab {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* 커뮤니티 빈 상태 */
.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-thumb,
  .comm-table .col-category,
  .comm-table .col-author,
  .comm-table .col-views,
  .comm-table .col-down {
    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: #008533;
  color: #fff;
}
.btn-naver:hover { background: #006e2a; }

/* =========================================
   첨부파일 미리보기 (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); }

/* =========================================
   첨부파일 작성 폼 미리보기 래퍼 (게시글·댓글 공용)
   - #comm-attach-preview (게시글 신규 작성)
   - #comm-comment-attach-preview (댓글 신규 작성)
   - #reply-attach-preview-{cid} (대댓글 작성)
   ========================================= */
.comm-attach-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 0;
}
.comm-attach-preview:empty {
  display: none;
}

/* =========================================
   댓글·대댓글 첨부파일 렌더 래퍼
   - .comment-attachments (JS 동적 생성)
   ========================================= */
.comment-attachments {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  margin-top: 6px;
}

/* 이미지 썸네일 — .comment-attach-img */
.comment-attach-img {
  display: block;
  max-width: 140px;
  width: auto;
  height: auto;
  max-height: 100px;
  border-radius: 6px;
  border: 1px solid var(--border);
  object-fit: cover;
  background: var(--bg-base);
  transition: opacity var(--transition);
}
.comment-attach-img:hover {
  opacity: 0.85;
}

/* 이미지 링크 래퍼 — .comment-attach-link (이미지 감싸는 <a>) */
.comment-attach-link {
  display: inline-block;
  line-height: 0;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

/* 문서/파일 텍스트 링크 — .comment-attach-link.comment-attach-file */
.comment-attach-link.comment-attach-file {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 12px;
  color: var(--text-link);
  text-decoration: none;
  word-break: break-all;
  line-height: 1.5;
  transition: background var(--transition), border-color var(--transition);
}
.comment-attach-link.comment-attach-file:hover {
  background: var(--accent-muted);
  border-color: var(--accent);
  text-decoration: underline;
}

/* 반응형: 모바일에서 썸네일 축소 */
@media (max-width: 480px) {
  .comment-attach-img {
    max-width: 100px;
    max-height: 80px;
  }
  .comment-attachments {
    gap: 6px;
  }
}

/* =========================================
   티커 테이프 (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-thumb,
  .comm-table .col-views,
  .comm-table .col-down { display: none; }

  .econ-table .td-time { font-size: 11px; }
}

/* =========================================
   포털형 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;
}

/* =========================================
   세션 만료 알림 모달 (session-expired-modal)
   계약: docs/plans/plan_20260608_session_expiry.md
   ========================================= */

/* 전체 고정 오버레이 컨테이너
   JS가 display:flex / display:none 을 토글한다.
   display:none 기본값은 HTML의 style 속성에서 선언하므로
   여기서는 flex 상태의 레이아웃만 정의. */
#session-expired-modal {
  position: fixed;
  inset: 0;
  z-index: 10100;           /* auth-modal(10000) 보다 위 */
  display: flex;            /* JS: display:none -> display:flex 전환 */
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* 반투명 배경 (클릭 차단) */
.session-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.60);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

/* 중앙 카드 */
.session-modal-box {
  position: relative;       /* backdrop 위에 렌더 */
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 28px 24px;
  max-width: 360px;
  width: 90%;               /* 모바일: 화면 폭 90% */
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: sessionModalPop 0.22s ease;
}

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

/* 안내 문구 */
.session-modal-msg {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
  word-break: keep-all;     /* 한국어 단어 중간 끊김 방지 */
}

/* 로그인 버튼 */
.session-modal-btn {
  display: block;
  width: 100%;
  padding: 13px 20px;       /* 터치 타깃 >= 44px 보장 */
  min-height: 44px;
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  text-align: center;
  line-height: 1;
}

.session-modal-btn:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.session-modal-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* 포커스 링 (키보드 접근성 — WCAG 2.1 AA) */
.session-modal-btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* 반응형: 매우 좁은 화면 */
@media (max-width: 400px) {
  .session-modal-box {
    padding: 24px 16px 20px;
  }
  .session-modal-msg {
    font-size: 13px;
  }
  .session-modal-btn {
    font-size: 14px;
  }
}

/* 다크 테마 오버라이드 */
body.dark-theme .session-modal-backdrop {
  background: rgba(0, 0, 0, 0.72);
}

body.dark-theme .session-modal-box {
  background: #161b22;
  border-color: #30363d;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65);
}

body.dark-theme .session-modal-msg {
  color: var(--text-secondary);  /* 다크: #8b949e — 대비 4.5:1 이상 */
}

body.dark-theme .session-modal-btn {
  background: var(--accent);     /* 다크: #58a6ff */
  color: #0d1117;                /* 다크 배경 대비 확보 */
}

body.dark-theme .session-modal-btn:hover {
  background: var(--accent-hover); /* 다크: #79b8ff */
}

body.dark-theme .session-modal-btn:focus-visible {
  outline-color: var(--accent);
}

/* =========================================
   마이페이지 섹터 그리드 (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;
}
/* 미디어 선택 칩 — JS가 부여하는 명시적 비활성 클래스 (app.js L6121)
   :has(input:disabled)와 동일 스타일로 일관성 유지 */
.mypage-sector-chip-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

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 낮게 유지해서 개별 버튼 스타일과 충돌 없도록 */

/* #15 fix: btn-subscribe는 별도 규칙으로 분리.
   transition 재정의가 Tailwind transition-colors(color + background-color)를
   덮어써 hover 시 텍스트가 사라지는 현상을 일으키므로,
   transform/box-shadow만 추가하고 transition은 건드리지 않는다.
   color: #fff 명시로 배경색 변경 시 텍스트 대비 WCAG AA 보장. */
.btn-subscribe:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  color: #fff;
}
body.dark-theme .btn-subscribe:hover {
  color: #fff;
}

.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;
  }
}

/* ── 공용 컴포넌트 프리미티브 (2026-06-11 W1b) ──────────────────────────────
   목적: 마크업이 참조하나 CSS 미정의된 공용 클래스 기반 제공.
   설계 원칙:
   - .btn 계열은 Tailwind 유틸(padding/color/bg)과 공존 — 레이아웃 기본값만 선언.
     Tailwind 유틸이 specificity에서 우선하므로 !important 금지.
   - 다크 모드: body.dark-theme 셀렉터 방식 (기존 파일 전체 방식과 동일).
   - 기존 규칙 수정 없음 (순수 추가 전용 섹션).
   ──────────────────────────────────────────────────────────────────────── */

/* =========================================
   버튼 공용 기반 (.btn)
   ========================================= */

/* .btn — 레이아웃/커서/전환 기본값.
   Tailwind 유틸이 없는 bare .btn(예: L159 "btn btn-sm")에 대해
   최소한의 시각적 형태를 보장한다.
   Tailwind 유틸이 있는 요소는 유틸이 패딩/색 등을 덮어 쓴다. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), box-shadow var(--transition),
              transform var(--transition);
  -webkit-user-select: none;
          user-select: none;
}
.btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* .btn-primary — 브랜드 색 채우기.
   Tailwind bg-brand/text-white가 있는 요소는 Tailwind가 우선 적용된다.
   Tailwind 유틸 없는 bare .btn-primary(예: L162 "btn btn-sm btn-primary")에
   폴백 스타일을 보장한다. */
.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
}
body.dark-theme .btn-primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}
body.dark-theme .btn-primary:hover {
  box-shadow: 0 2px 6px rgba(88, 166, 255, 0.35);
}

/* .btn-sm — 소형 버튼 (패딩/폰트 축소).
   Tailwind py-*/px-* 유틸이 있는 요소는 Tailwind가 우선한다. */
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 6px;
}

/* .btn-outline — 외곽선 버튼.
   Tailwind border-*/text-* 유틸이 있는 요소는 Tailwind가 우선한다. */
.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-outline:hover {
  background: var(--accent-muted);
  color: var(--accent);
  border-color: var(--accent);
}
body.dark-theme .btn-outline {
  color: var(--text-secondary);
  border-color: var(--border);
}
body.dark-theme .btn-outline:hover {
  background: var(--accent-muted);
  color: var(--accent);
}

/* .btn-danger — 위험 액션 (탈퇴 확인 등).
   Tailwind bg-red-*/text-white가 있는 요소는 Tailwind가 우선한다. */
.btn-danger {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}
.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.30);
}
.btn-danger:active {
  transform: translateY(0);
  box-shadow: none;
}
body.dark-theme .btn-danger {
  background: #f85149;
  border-color: #f85149;
}
body.dark-theme .btn-danger:hover {
  background: #ef4444;
  border-color: #ef4444;
}

/* .btn-ghost — 배경 없는 텍스트 버튼.
   Tailwind text-*/hover:bg-* 유틸이 함께 있는 경우 Tailwind가 우선한다. */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--accent-muted);
  color: var(--accent);
}
body.dark-theme .btn-ghost:hover {
  background: rgba(88, 166, 255, 0.10);
  color: var(--accent);
}

/* .btn-icon — 아이콘 전용 정사각 버튼.
   Tailwind p-*/rounded-* 유틸이 있는 요소는 Tailwind가 우선한다. */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  line-height: 1;
}
.btn-icon:hover {
  background: var(--accent-muted);
  color: var(--accent);
}
body.dark-theme .btn-icon:hover {
  background: rgba(88, 166, 255, 0.10);
}

/* =========================================
   공용 모달 패밀리
   (.modal-overlay / .modal-dialog / .modal-title / .modal-actions)
   기존 auth-modal-overlay(z:10000), session-modal(z:10100)과 z-index 정합.
   delivery-verify-modal(결함 A-2) 해소용.
   ========================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10050;           /* auth-modal(10000)보다 위, session-modal(10100)보다 아래 */
  padding: 16px;
  animation: authModalFade 0.18s ease; /* 기존 keyframe 재사용 */
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 28px 22px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: authModalPop 0.20s ease; /* 기존 keyframe 재사용 */
}
body.dark-theme .modal-dialog {
  background: var(--bg-card);
  border-color: var(--border);
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}
body.dark-theme .modal-title {
  color: var(--text-primary);
}

.modal-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* =========================================
   공용 폼 유틸
   ========================================= */

/* .error-msg — 폼 인라인 에러 텍스트 (3회 사용) */
.error-msg {
  font-size: 12px;
  color: #dc2626;
  line-height: 1.4;
}
body.dark-theme .error-msg {
  color: #f87171;
}

/* =========================================
   공용 레이아웃 유틸
   ========================================= */

/* .footer-sep — 푸터 구분자 (6회 사용).
   Tailwind text-gray-*/dark:text-gray-* 와 함께 쓰이므로 색은 선언하지 않음. */
.footer-sep {
  display: inline-block;
  margin: 0 4px;
  line-height: 1;
  pointer-events: none;
  -webkit-user-select: none;
          user-select: none;
}

/* =========================================
   신고 모달 전용 (report-modal)
   .modal-overlay / .modal-dialog / .modal-title / .modal-actions 는 공용 재사용.
   ========================================= */

/* 모달 상단 안내문 */
.report-modal-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 14px;
}

/* 신고 사유 라디오 행 */
.report-reason-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  transition: all .15s;
}
.report-reason-option:hover {
  border-color: var(--accent);
  background: var(--accent-muted);
}
.report-reason-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-muted);
  font-weight: 600;
}
.report-reason-option input[type=radio] {
  accent-color: var(--accent);
}

/* 상세 신고 textarea */
.report-detail {
  width: 100%;
  min-height: 64px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  margin-top: 6px;
  background: var(--bg-card);
  color: var(--text-primary);
  box-sizing: border-box;
}
.report-detail:focus {
  outline: none;
  border-color: var(--accent);
}

/* .page-title — 페이지 헤더 제목 (1회 사용).
   Tailwind text-xl/font-bold/text-gray-* 와 함께 쓰이므로 기본값만. */
.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}
body.dark-theme .page-title {
  color: var(--text-primary);
}

/* ── END 공용 컴포넌트 프리미티브 (W1b) ─────────────────────────────────── */

/* ── 마이페이지 컴포넌트 (2026-06-11 W1c) ────────────────────────────────
   목적: 마이페이지 계열 클래스 중 CSS 미정의 항목에 최소 폴백 제공.
   설계 원칙:
   - Tailwind 유틸이 이미 같은 속성을 선언하는 경우 해당 속성은 선언하지 않음
     (충돌 항목: color, padding, gap, flex-direction, font-size 등).
   - Tailwind 유틸이 없는 bare 사용처(delivery-email-input 등)에 완전한 스타일 보장.
   - !important 금지.
   - 다크 모드: body.dark-theme 셀렉터 방식 (기존 파일 전체 방식과 동일).
   - 기존 규칙 수정 없음 (순수 추가 전용 섹션).

   훅 판정 (Tailwind 완전 스타일됨 — CSS 정의 불필요, 목록만 기록):
     mypage-avatar, mypage-content, mypage-field-edit, mypage-field-hint,
     mypage-field-row-avatar, mypage-field-value, mypage-mobile-tab-danger,
     mypage-mobile-tabs, mypage-modal, mypage-modal-actions, mypage-modal-body,
     mypage-modal-overlay, mypage-modal-title, mypage-menu-danger,
     mypage-panel-danger, mypage-panel-footer, mypage-panel-title,
     mypage-panel-title-danger, mypage-sidebar-name, mypage-sidebar-tier,
     mypage-theme-options, mypage-toggle-desc.
   ──────────────────────────────────────────────────────────────────────── */

/* =========================================
   mypage-field-row — 라벨/값/버튼 행
   ========================================= */

/* 기본 행: Tailwind flex items-center justify-between 없는 bare 사용처
   (예: mypage-add-email-section, mypage-email-verify-section)에 폴백.
   Tailwind flex/items-center/justify-between 가 있으면 Tailwind 우선. */
.mypage-field-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

/* 좁은 폭 스택: 640px 미만에서 세로 쌓기 */
@media (max-width: 640px) {
  .mypage-field-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
}

/* =========================================
   mypage-toggle-row — 토글 행 (행 정렬)
   ========================================= */

/* mypage-toggle-row는 항상 mypage-field-row와 함께 쓰인다.
   Tailwind flex items-center justify-between 있음 — 여기선 보조 속성만. */
.mypage-toggle-row {
  flex-wrap: nowrap;
}

/* =========================================
   mypage-toggle-label — 토글 행 라벨 영역
   ========================================= */

/* Tailwind 없음 — flex 컬럼 형태로 제목+설명 세로 배치. */
.mypage-toggle-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}
body.dark-theme .mypage-toggle-label {
  color: var(--text-primary);
}

/* =========================================
   mypage-input — 입력 필드 (핵심 결함 복구)
   ========================================= */

/* bare 사용처: delivery-email-input(L1687), delivery-verify-code(L2311),
   sub-email-other-input(L2281), sub-email-verify-code(L2296) — Tailwind 유틸 없음.
   완전한 테두리/패딩/radius/배경/포커스 정의 필요.
   Tailwind 유틸이 있는 요소(px-3 py-2 border border-gray-200 등)는
   Tailwind가 padding/border-color 우선 적용한다.
   여기서는 Tailwind가 없는 bare 요소를 위해 전체 정의. */
.mypage-input {
  display: block;
  width: 100%;
  padding: 8px 12px;
  font-size: 0.875rem;
  font-family: var(--font);
  line-height: 1.5;
  color: var(--text-primary);
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  min-width: 0;
}
.mypage-input::placeholder {
  color: var(--text-muted);
}
.mypage-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.mypage-input:disabled,
.mypage-input[readonly] {
  background: #f9fafb;
  color: var(--text-secondary);
  cursor: default;
}
/* select 요소 화살표 표시 */
.mypage-input[multiple] {
  padding: 4px;
}
body.dark-theme .mypage-input {
  color: var(--text-primary);
  background: #374151;
  border-color: #4b5563;
}
body.dark-theme .mypage-input::placeholder {
  color: var(--text-muted);
}
body.dark-theme .mypage-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}
body.dark-theme .mypage-input:disabled,
body.dark-theme .mypage-input[readonly] {
  background: #1f2937;
  color: var(--text-secondary);
}

/* =========================================
   mypage-readonly — 읽기 전용 값 표시
   ========================================= */

/* Tailwind text-sm text-gray-800 dark:text-gray-200 있음 — 레이아웃 보조만. */
.mypage-readonly {
  display: inline-block;
  cursor: default;
  -webkit-user-select: text;
          user-select: text;
}

/* =========================================
   mypage-locked-block — Basic 잠금 안내 박스
   ========================================= */

/* Tailwind rounded-lg p-4 text-center 있음.
   배경/테두리/색은 Tailwind 없음 — 여기서 제공. */
.mypage-locked-block {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: var(--text-secondary);
}
body.dark-theme .mypage-locked-block {
  background: #1f2937;
  border-color: #374151;
  color: var(--text-secondary);
}

/* =========================================
   mypage-plan-badge — Pro/Basic 배지
   ========================================= */

/* Tailwind text-xs px-2 py-0.5 rounded-full font-medium 있음.
   배경색/글자색은 JS가 -pro/-basic 변형 클래스로 추가 — 기본은 비어 있음.
   기본 상태(빈 텍스트)에서는 표시되지 않으므로 레이아웃만 보장. */
.mypage-plan-badge {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Pro 배지 — 브랜드 amber 톤 (기존 --pro-color 토큰 사용) */
.mypage-plan-badge-pro {
  background: var(--pro-bg);
  color: var(--pro-color);
}
body.dark-theme .mypage-plan-badge-pro {
  background: var(--pro-bg);
  color: var(--pro-color);
}

/* Basic 배지 — 회색 중립 톤 */
.mypage-plan-badge-basic {
  background: rgba(107, 114, 128, 0.10);
  color: #4b5563;
}
body.dark-theme .mypage-plan-badge-basic {
  background: rgba(107, 114, 128, 0.15);
  color: #9ca3af;
}

/* =========================================
   mypage-field-col — 세로 컬럼 필드 영역
   ========================================= */

/* 비밀번호 변경 패널에서 라벨+인풋 세로 배치.
   Tailwind mb-4/mb-6 있음 — display/flex-direction만 선언. */
.mypage-field-col {
  display: flex;
  flex-direction: column;
}

/* =========================================
   mypage-field-btn — 행 내 버튼
   ========================================= */

/* Tailwind 유틸(px-3 py-1.5 text-sm border rounded-lg 등) 충분.
   flex-shrink 방지 + align 보조만 선언. */
.mypage-field-btn {
  flex-shrink: 0;
  align-self: center;
}

/* =========================================
   setting-row — 수신 이메일 섹션 래퍼
   ========================================= */

/* Tailwind border-t border-gray-100 dark:border-gray-700 mt-4 pt-4 있음.
   display 폴백만 제공. */
.setting-row {
  display: block;
}

/* ── 마이페이지 컴포넌트 잔여 (W1c-2) ── */

/* =========================================
   mypage-panel-footer — 패널 하단 액션 영역
   ========================================= */

/* Tailwind mt-6 있음 — display 폴백만.
   mypage-panel-footer: subscriptions L1443, security L1718 */
.mypage-panel-footer {
  display: block;
}

/* =========================================
   mypage-theme-options — 테마 선택 버튼 그룹
   ========================================= */

/* Tailwind flex gap-2 있음 — role=group 접근성 보조.
   align-items 폴백 제공. */
.mypage-theme-options {
  align-items: center;
}

/* =========================================
   mypage-field-row-avatar — 아바타 행 구분
   ========================================= */

/* mypage-field-row와 함께 쓰임 (L1347).
   Tailwind flex items-center justify-between py-4 border-b 있음.
   avatar 특화: 상단 패딩 보조(아바타 사진 크기 대응). */
.mypage-field-row-avatar {
  align-items: center;
}

/* =========================================
   mypage-content — 우측 컨텐츠 래퍼
   ========================================= */

/* Tailwind flex-1 있음 — min-width 폴백.
   flex-1 자식이 overflow-x를 유발하지 않도록 최소 너비 보장. */
.mypage-content {
  min-width: 0;
}

/* 모바일 전체 너비 */
@media (max-width: 767px) {
  .mypage-content {
    width: 100%;
  }
}

/* ── END 마이페이지 컴포넌트 (W1c) ──────────────────────────────────────── */

/* ── 인증 컴포넌트 (W1d) ──────────────────────────────────────────────── */

/*
 * 훅 판정 목록 (Tailwind 완전 보유 — CSS 정의 생략):
 *   auth-label       — block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1.5
 *   auth-input       — w-full px-3 py-2.5 text-sm border rounded-lg 다크모드 전체 Tailwind 처리
 *   auth-title       — text-2xl font-bold text-gray-900 dark:text-gray-100 text-center mb-6
 *   auth-switch      — text-center text-sm text-gray-500 dark:text-gray-400 mt-6
 *   auth-social      — space-y-2 (Tailwind 처리)
 *   auth-nav-group   — flex items-center gap-2 (Tailwind 처리)
 *   auth-divider     — flex items-center gap-3 mb-4 (Tailwind 처리)
 *   auth-agree-item  — mb-3 (Tailwind 처리, flex는 자식 label에 있음)
 *   auth-agree-all   — flex items-center gap-2 mb-3 pb-3 border-b cursor-pointer 완전 Tailwind
 *   auth-agree-all-text — text-sm font-semibold text-gray-800 dark:text-gray-200 완전 Tailwind
 *   auth-agree-link  — text-brand hover:underline dark:text-blue-400 완전 Tailwind
 *   auth-hint        — block text-xs text-gray-400 dark:text-gray-500 mt-1 완전 Tailwind
 *   auth-container   — min-h-screen flex items-center justify-center px-4 py-12 완전 Tailwind
 *   auth-field       — mb-4 / mb-5 / mb-6 완전 Tailwind
 *   register-pw-bar  — JS가 className 완전 재설정(Tailwind 전용), CSS 정의 불필요
 */

/* =========================================
   auth-field-group — 입력 그룹 블록 래퍼
   ========================================= */

/* 자식 flex 래퍼를 담는 블록 컨테이너.
   flex-1 자식이 overflow-x를 유발하지 않도록 최소 너비 보호. */
.auth-field-group {
  display: block;
  min-width: 0;
}

/* =========================================
   auth-agree-group — 약관 동의 fieldset 리셋
   ========================================= */

/* fieldset 기본 border/padding/margin을 제거하여
   Tailwind mb-6 등 유틸리티와 충돌하지 않도록 한다. */
.auth-agree-group {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

/* =========================================
   auth-agree-divider — 동의 항목 구분선
   ========================================= */

/* 전체 동의 라벨과 개별 항목 사이 시각적 구분.
   border-t로 얇은 선을 추가하고 여백을 확보한다. */
.auth-agree-divider {
  border-top: 1px solid #f3f4f6;
  margin-bottom: 0.75rem;
}

@media (prefers-color-scheme: dark) {
  .auth-agree-divider {
    border-top-color: #374151;
  }
}

.dark .auth-agree-divider {
  border-top-color: #374151;
}

/* =========================================
   auth-checkbox — 체크박스 접근성 보강
   ========================================= */

/* Tailwind rounded text-brand 에 더해
   키보드 focus-visible 링을 브랜드 색으로 명시한다.
   브라우저 기본 outline을 대체하여 WCAG 2.1 AA 대비 보장. */
.auth-checkbox:focus-visible {
  outline: 2px solid var(--color-brand, #3b82f6);
  outline-offset: 2px;
}

@media (prefers-color-scheme: dark) {
  .auth-checkbox:focus-visible {
    outline-color: #60a5fa;
  }
}

.dark .auth-checkbox:focus-visible {
  outline-color: #60a5fa;
}

/* =========================================
   register-field-error — 필드 에러 문구
   ========================================= */

/* inline span이므로 표시 시 줄 바꿈을 보장하고
   위 요소와의 간격을 확보한다.
   Tailwind text-xs text-red-500 mt-1 이미 있음 — 레이아웃 폴백만. */
.register-field-error {
  display: block;
  min-height: 0;
}

@media (prefers-color-scheme: dark) {
  .register-field-error {
    color: #f87171;
  }
}

.dark .register-field-error {
  color: #f87171;
}

/* ── END 인증 컴포넌트 (W1d) ──────────────────────────────────────────── */

/* ── 커뮤니티 컴포넌트 (W1e) ─────────────────────────────────────────── */

/* =========================================
   훅 판정 (Tailwind 완전 보유 — CSS 폴백 불필요)
   comm-input          : w-full px-3 py-2 text-sm border rounded-lg bg-white dark:* focus:ring-2
   comm-textarea       : 동일 Tailwind 세트 완비
   comm-write-form     : portal-section mb-4 완비
   comm-write-header   : flex items-center justify-between px-5 py-4 border-b 완비
   comm-write-body     : px-5 py-4 space-y-3 완비
   comm-write-footer   : flex items-center justify-end gap-2 px-5 py-4 border-t 완비
   comm-write-close    : text-gray-400 hover:text-gray-600 transition-colors 완비
   comm-write-btn      : btn btn-primary px-4 py-2 text-sm bg-brand rounded-lg 완비
   comm-write-title    : text-base font-semibold text-gray-900 완비
   comm-header         : flex items-center justify-between mb-4 완비
   comm-hot-section    : rounded-xl p-4 mb-4 + inline style 완비
   comm-hot-header     : flex items-center gap-2 mb-3 완비
   comm-hot-badge      : inline-flex px-2 py-0.5 rounded-full text-xs font-bold 완비
   comm-hot-label      : text-sm font-semibold text-gray-700 완비
   comm-hot-list       : space-y-1 완비
   comm-search-bar     : flex gap-2 items-center 완비
   comm-search-btn     : btn px-4 py-2 text-sm bg-brand rounded-lg 완비
   ========================================= */

/* =========================================
   comm-search-select / comm-search-input
   inline style(background/border) 의존 + focus:ring Tailwind
   — border, border-radius, height 폴백만 추가
   ========================================= */
.comm-search-select {
  border: 1px solid var(--border);
  border-radius: 8px;
  height: 38px;
  color: var(--text-primary);
  cursor: pointer;
}

@media (prefers-color-scheme: dark) {
  .comm-search-select {
    border-color: #374151;
    color: #f3f4f6;
  }
}

.dark .comm-search-select {
  border-color: #374151;
  color: #f3f4f6;
}

.comm-search-input {
  border: 1px solid var(--border);
  border-radius: 8px;
  height: 38px;
  color: var(--text-primary);
  min-width: 0;
}

@media (prefers-color-scheme: dark) {
  .comm-search-input {
    border-color: #374151;
    color: #f3f4f6;
  }
}

.dark .comm-search-input {
  border-color: #374151;
  color: #f3f4f6;
}

/* =========================================
   comm-attach-btn
   label 역할 파일 첨부 트리거 버튼 — 답글/댓글 폼 모두 사용
   ========================================= */
.comm-attach-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition, 0.15s), color var(--transition, 0.15s);
}

.comm-attach-btn:hover {
  background: var(--bg-hover, rgba(0,0,0,0.04));
  color: var(--text-primary);
}

@media (prefers-color-scheme: dark) {
  .comm-attach-btn {
    border-color: #374151;
    color: #9ca3af;
  }
  .comm-attach-btn:hover {
    background: rgba(255,255,255,0.06);
    color: #f3f4f6;
  }
}

.dark .comm-attach-btn {
  border-color: #374151;
  color: #9ca3af;
}

.dark .comm-attach-btn:hover {
  background: rgba(255,255,255,0.06);
  color: #f3f4f6;
}

/* =========================================
   comm-attach-area
   첨부파일 드래그 드롭 영역 (폴백)
   ========================================= */
.comm-attach-area {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

@media (prefers-color-scheme: dark) {
  .comm-attach-area {
    border-color: #374151;
    color: #6b7280;
  }
}

.dark .comm-attach-area {
  border-color: #374151;
  color: #6b7280;
}

/* =========================================
   comm-attach-thumb / comm-attach-name / comm-attach-uploading
   첨부 미리보기 하위 요소
   ========================================= */
.comm-attach-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.comm-attach-name {
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comm-attach-uploading {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* =========================================
   comm-anon-label (JS 빌더용 — 답글 폼)
   HTML에서는 comment-anon-label(이미 정의됨)
   JS reply-form 빌더는 comment-anon-label 사용 → 동일 처리
   ========================================= */
.comm-anon-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

/* comm-hot-item — 제거됨 (v20260820: best-widget 로 교체) */

/* =========================================
   답글 폼 textarea 생짜 박스 결함 해소
   .comment-reply-form textarea 기존 규칙에
   padding / border / border-radius / background 누락 →
   .comment-form textarea 와 동질 스타일로 보강
   ========================================= */
.comment-reply-form textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  box-sizing: border-box;
}

.comment-reply-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb, 59,130,246), 0.15);
}

@media (prefers-color-scheme: dark) {
  .comment-reply-form textarea {
    background: #0d1117;
    border-color: #30363d;
    color: #e6edf3;
  }
}

.dark .comment-reply-form textarea {
  background: #0d1117;
  border-color: #30363d;
  color: #e6edf3;
}

/* =========================================
   comment-reply-form-actions
   답글 폼 하단 버튼 행 — flex, 익명 라벨 + 첨부 버튼 gap 해소
   ========================================= */
.comment-reply-form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

/* =========================================
   comment-edit-form
   댓글 수정 폼 컨테이너 (JS 빌더 주입)
   ========================================= */
.comment-edit-form {
  margin-top: 8px;
  padding: 10px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 8px;
}

@media (prefers-color-scheme: dark) {
  .comment-edit-form {
    background: #0d1117;
    border-color: #30363d;
  }
}

.dark .comment-edit-form {
  background: #0d1117;
  border-color: #30363d;
}

/* =========================================
   comment-edit-textarea
   댓글 수정 입력창 — comment-form textarea 와 동질 스타일
   ========================================= */
.comment-edit-textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  box-sizing: border-box;
  font-family: inherit;
}

.comment-edit-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb, 59,130,246), 0.15);
}

@media (prefers-color-scheme: dark) {
  .comment-edit-textarea {
    background: #0d1117;
    border-color: #30363d;
    color: #e6edf3;
  }
}

.dark .comment-edit-textarea {
  background: #0d1117;
  border-color: #30363d;
  color: #e6edf3;
}

/* =========================================
   comment-edit-form-error
   수정 폼 에러 메시지 (초기 hidden, JS show)
   ========================================= */
.comment-edit-form-error {
  display: none;
  font-size: 12px;
  color: #dc2626;
  margin-top: 4px;
  min-height: 0;
}

@media (prefers-color-scheme: dark) {
  .comment-edit-form-error {
    color: #f87171;
  }
}

.dark .comment-edit-form-error {
  color: #f87171;
}

/* =========================================
   comment-edit-form-actions
   수정 폼 하단 버튼 행
   ========================================= */
.comment-edit-form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

/* =========================================
   comment-edit-char-count
   수정 폼 글자 수 카운터
   ========================================= */
.comment-edit-char-count {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}

/* =========================================
   comment-report-btn
   신고 텍스트 버튼 (작은 muted, hover 강조)
   ========================================= */
.comment-report-btn {
  background: none;
  border: none;
  padding: 2px 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: color var(--transition, 0.15s), background var(--transition, 0.15s);
}

.comment-report-btn:hover {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}

@media (prefers-color-scheme: dark) {
  .comment-report-btn {
    color: #6b7280;
  }
  .comment-report-btn:hover {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
  }
}

.dark .comment-report-btn {
  color: #6b7280;
}

.dark .comment-report-btn:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}

/* =========================================
   btn-comment-edit-save / btn-comment-edit-cancel
   댓글 수정 폼 저장/취소 버튼
   ========================================= */
.btn-comment-edit-save {
  padding: 5px 14px;
  border-radius: 6px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition, 0.15s);
}

.btn-comment-edit-save:hover:not(:disabled) {
  background: var(--accent-hover, #2563eb);
}

.btn-comment-edit-save:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-comment-edit-cancel {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  padding: 5px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: color var(--transition, 0.15s), border-color var(--transition, 0.15s);
}

.btn-comment-edit-cancel:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

/* ── END 커뮤니티 컴포넌트 (W1e) ──────────────────────────────────────── */

/* ── 잔여 컴포넌트 (W1f) ──────────────────────────────────────────────── */

/* =========================================
   legal-body
   약관/개인정보 마크다운 렌더링 영역
   자본시장법/개인정보보호법 본문 가독성 확보
   ========================================= */
.legal-body {
  color: var(--text-primary);
  line-height: 1.75;
  font-size: 14px;
}

.legal-body h1,
.legal-body h2,
.legal-body h3 {
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  color: var(--text-primary);
}

.legal-body h1 { font-size: 1.25rem; }
.legal-body h2 { font-size: 1.1rem; }
.legal-body h3 { font-size: 1rem; }

.legal-body p {
  margin-bottom: 0.75em;
}

.legal-body ul,
.legal-body ol {
  padding-left: 1.5em;
  margin-bottom: 0.75em;
}

.legal-body li {
  margin-bottom: 0.25em;
}

.legal-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 1em;
  overflow-x: auto;
  display: block;
}

.legal-body th,
.legal-body td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}

.legal-body th {
  background: var(--bg-secondary);
  font-weight: 600;
}

.legal-body tr:nth-child(even) td {
  background: var(--bg-secondary, #f9fafb);
}

@media (prefers-color-scheme: dark) {
  .legal-body {
    color: #e5e7eb;
  }
  .legal-body h1,
  .legal-body h2,
  .legal-body h3 {
    color: #f3f4f6;
  }
  .legal-body th {
    background: #374151;
  }
  .legal-body tr:nth-child(even) td {
    background: #1f2937;
  }
}

.dark .legal-body {
  color: #e5e7eb;
}

.dark .legal-body h1,
.dark .legal-body h2,
.dark .legal-body h3 {
  color: #f3f4f6;
}

.dark .legal-body th {
  background: #374151;
}

.dark .legal-body tr:nth-child(even) td {
  background: #1f2937;
}

/* ── END 잔여 컴포넌트 (W1f) ──────────────────────────────────────────── */

/* ── 댓글 UX (W4) ──────────────────────────────────────────────────────── */

/* =========================================
   1. 등록 직후 하이라이트 — comment-just-posted
   scrollIntoView 후 2초간 연한 브랜드색 fade
   ========================================= */
@keyframes comment-highlight-fade {
  0%   { background-color: rgba(59, 130, 246, 0.12); }
  100% { background-color: transparent; }
}

.comment-just-posted {
  animation: comment-highlight-fade 2s ease-out forwards;
  border-radius: 6px;
}

body.dark-theme .comment-just-posted {
  animation: comment-highlight-fade-dark 2s ease-out forwards;
}

@keyframes comment-highlight-fade-dark {
  0%   { background-color: rgba(96, 165, 250, 0.15); }
  100% { background-color: transparent; }
}

/* =========================================
   2. 답글 폼 시각 연결 — .comment-reply-form
   .comment-reply 와 동질의 들여쓰기 + 좌측 보더
   ========================================= */
.comment-reply-form {
  margin-left: 28px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}

body.dark-theme .comment-reply-form {
  border-left-color: #30363d;
}

/* =========================================
   3. 댓글 액션 버튼 터치 타깃 보강
   btn-comment-reply / btn-comment-delete /
   btn-comment-report / btn-comment-edit
   ========================================= */
.btn-comment-reply,
.btn-comment-delete,
.btn-comment-report,
.btn-comment-edit {
  padding: 4px 6px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
}

@media (max-width: 767px) {
  .btn-comment-reply,
  .btn-comment-delete,
  .btn-comment-report,
  .btn-comment-edit {
    font-size: 13px;
    padding: 5px 8px;
    min-height: 32px;
  }

  .comment-item-actions {
    gap: 6px;
    flex-wrap: wrap;
  }
}

/* ── END 댓글 UX (W4) ──────────────────────────────────────────────────── */

/* ── 전반 polish (W6) ────────────────────────────────────────────────────── */

/* C-2: 추천/비추천 버튼 컴팩트 가로 레이아웃
   기존 .btn-vote(column, 96px, 14px 24px)를 더 구체적인 셀렉터로 override.
   !important 미사용. post-detail-view 내부로 범위 한정. */
.post-detail-view .btn-vote {
  flex-direction: row;
  gap: 6px;
  min-width: 0;
  padding: 8px 16px;
  border-radius: 8px;
}

.post-detail-view .btn-vote .vote-icon {
  font-size: 14px;
  line-height: 1;
}

.post-detail-view .btn-vote .vote-label {
  font-size: 12px;
}

.post-detail-view .btn-vote .vote-count {
  font-size: 13px;
  font-weight: 700;
}

/* 모바일(640px 이하) override — 기존 min-width:80px / padding 덮어쓰기 */
@media (max-width: 640px) {
  .post-detail-view .btn-vote {
    min-width: 0;
    padding: 7px 12px;
  }
}

@media (max-width: 400px) {
  .post-detail-view .btn-vote {
    min-width: 0;
    padding: 6px 10px;
  }
}

/* C-4: 모바일 피드 AI 요약 2줄 line-clamp
   R16(.news-item-meta min-width:72px / max-width:110px) 보존.
   .ai-text 폭/word-break만 조정, .news-item-meta 규칙 미변경. */
@media (max-width: 767px) {
  .ai-text {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: clip;
    word-break: break-word;
  }
}

/* ── END 전반 polish (W6) ───────────────────────────────────────────────── */

/* ── 모바일 가독성 W8 ──────────────────────────────────────────────────────
   대상: @media (max-width: 767px) 한정. 데스크탑 규칙 무변경.
   A. 뉴스 아이템 제목 잘림 해소 (.news-item 계열, 홈 위젯 + 피드 공용)
   B. 경제캘린더 월 그리드 셀 이벤트 칩 → 색 바 전환 (텍스트 1글자 잘림 해소)
   R16 보존 게이트: 데스크탑 .news-item-meta { min-width:72px; max-width:110px }
   (L549) 는 이 미디어쿼리 밖에 있어 무변경. 모바일에서 메타가 별도 하단 행이
   되므로 AI요약-날짜 겹침 원천 제거됨.
   ─────────────────────────────────────────────────────────────────────── */

@media (max-width: 767px) {

  /* ── A-1. 뉴스 아이템 제목: 1줄 → 2줄 clamp (데스크탑 1줄 유지) ── */
  .news-item-title {
    -webkit-line-clamp: 2;
  }

  /* ── A-2. 뉴스 아이템 flex-wrap: 제목/AI 전폭 확보, 메타 하단 풀폭 행 ── */
  .news-item {
    flex-wrap: wrap;
  }

  /* 메타 영역을 하단 별도 행으로 내려 전폭 확보.
     내부 출처-날짜는 flex-direction: row(기존 column) + flex-end 유지.
     min-width / max-width는 모바일에서 별도 행이므로 100% 폭으로 재정의.
     order: 1로 .news-item-content(기본 order:0) 뒤에 위치. */
  .news-item-meta {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    min-width: 100%;
    max-width: none;
    order: 1;
    justify-content: flex-end;
    padding-top: 4px;
  }

  /* 출처 span: 좌측 ellipsis, 최대 폭 제한으로 날짜와 공존 */
  .news-item-meta .news-item-source {
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* 날짜 span: nowrap 보장 */
  .news-item-meta .news-item-time {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* ── A-3. .issue-post-item 보강: .news-item-meta는 이미 flex-direction:row
     (L1028~1036)이고 min-width:0. 하단 행 전환을 위해 min-width 보강만. ── */
  .issue-post-item .news-item-meta {
    min-width: 100%;
    order: 1;
  }

  /* ── B-1. 캘린더 이벤트 칩 → 색 바 전환 ──
     텍스트를 숨기고 높이 5px 컬러 바로 대체.
     색은 기존 .cal-evt-high/-mid/-low 배경 기준으로 더 진하게 지정.
     (기존: rgba(R,G,B,0.15) 배경 + 색 텍스트 → 바: 진한 단색 배경)
     데스크탑 .cal-evt 텍스트 규칙은 이 블록 밖이므로 무변경. */
  .cal-evt {
    font-size: 0;
    line-height: 0;
    overflow: hidden;
    padding: 0;
    height: 5px;
    border-radius: 3px;
    margin-top: 2px;
    white-space: nowrap;
    text-overflow: clip;
  }

  /* 각 중요도 바 색상: 배경색을 기존 color 값 기반으로 진하게 적용 */
  .cal-evt.cal-evt-high {
    background: rgba(220, 38, 38, 0.75);
  }
  .cal-evt.cal-evt-mid {
    background: rgba(217, 119, 6, 0.75);
  }
  .cal-evt.cal-evt-low {
    background: rgba(107, 114, 128, 0.6);
  }

  /* ── B-2. 셀 이벤트 컨테이너 높이 제한: 바 3개분(5px*3 + gap 1px*2 = 17px) ── */
  .cal-cell-events {
    overflow: hidden;
    max-height: 17px;
  }

  /* ── B-3. .cal-day-num 모바일 약간 축소 (가독성 유지 선) ── */
  .cal-day-num {
    font-size: 12px;
  }

  /* ── B-4. 다크모드: 바 색상 밝기 보정 (배경이 어두워지므로 opacity 상향) ── */
  body.dark-theme .cal-evt.cal-evt-high {
    background: rgba(248, 113, 113, 0.75);
  }
  body.dark-theme .cal-evt.cal-evt-mid {
    background: rgba(251, 191, 36, 0.7);
  }
  body.dark-theme .cal-evt.cal-evt-low {
    background: rgba(156, 163, 175, 0.65);
  }

}

/* ── END 모바일 가독성 W8 ───────────────────────────────────────────────── */

/* ── 모바일 가독성 W9 잔여 잘림 ────────────────────────────────────────────
   [1] .news-item-title: 2줄 → 3줄 clamp (모바일 긴 제목 SEVERE r=2.0 해소)
       W8의 2줄이 동일 선택자·동일 명시도이므로 W9가 후순위로 이긴다.
   [2] .news-item gap/padding: 좌우 각 12px로 제목 영역 +~12px 확보.
   데스크탑(.news-item-title 기본 1줄 / .news-item-first 2줄) 무변경.
   ─────────────────────────────────────────────────────────────────────── */

@media (max-width: 767px) {

  /* [1] 긴 제목 3줄 허용 — W8 2줄 정의를 후순위에서 덮어쓴다 */
  .news-item-title {
    -webkit-line-clamp: 3;
  }

  /* [2] 아이템 좌우 패딩 보강으로 제목 영역 확보 */
  .news-item {
    gap: 10px;
    padding-left: 12px;
    padding-right: 12px;
  }

}

/* ── W9 잔여 잘림 ── */

/* =========================================
   오늘의/주간 베스트 위젯 (v20260820)
   ========================================= */

/* 2컬럼 그리드 컨테이너 */
.best-widgets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 767px) {
  .best-widgets {
    grid-template-columns: 1fr;
  }
}

/* 개별 위젯 카드 */
.best-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}

/* 위젯 제목 */
.best-widget-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* 개별 항목 (링크 행) */
.best-widget-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  text-decoration: none;
  color: var(--text-primary);
  border-radius: 6px;
  transition: background 0.15s;
}
.best-widget-item:hover {
  background: var(--accent-muted);
}

/* 순위 숫자 */
.best-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* 1~3위 강조 */
.best-rank-top {
  color: var(--accent);
}

/* 제목 (1줄 말줄임) */
.best-title {
  flex: 1;
  font-size: 13px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 추천수 */
.best-up {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}

/* 집계 없음 메시지 */
.best-widget-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 0;
  margin: 0;
}

/* =========================================
   커뮤니티 상세 UI 개편 (v20260820a)
   ========================================= */

/* 게시판 분류 칩 */
.post-board-chip {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--accent, #2563eb);
  color: #fff;
  margin-right: 6px;
  vertical-align: middle;
}

/* 베스트 댓글 섹션 */
.best-comments-box {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: var(--bg-card, #f8fafc);
}
:root[data-theme="dark"] .best-comments-box,
body.dark-theme .best-comments-box {
  background: #161b22;
  border-color: #30363d;
}

.best-comments-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.best-comment-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border, #e2e8f0);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px;
}
.best-comment-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
body.dark-theme .best-comment-item {
  border-color: #30363d;
}

.best-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  background: #f59e0b;
  color: #fff;
  flex-shrink: 0;
}

.best-comment-author {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #374151);
  flex-shrink: 0;
}
body.dark-theme .best-comment-author {
  color: #c9d1d9;
}

.best-comment-body {
  width: 100%;
  font-size: 13px;
  color: var(--text-primary, #111827);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
body.dark-theme .best-comment-body {
  color: #e6edf3;
}

.best-attach-img {
  max-height: 60px;
  border-radius: 4px;
  object-fit: cover;
}

.best-comment-footer {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.best-comment-up {
  font-size: 12px;
  color: var(--text-muted, #6b7280);
}

.best-comment-view-btn {
  background: none;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
  color: var(--accent, #2563eb);
  transition: background var(--transition, 0.15s);
}
.best-comment-view-btn:hover {
  background: var(--bg-hover, #f1f5f9);
}
body.dark-theme .best-comment-view-btn {
  border-color: #30363d;
  color: #58a6ff;
}
body.dark-theme .best-comment-view-btn:hover {
  background: #21262d;
}

/* 댓글 폼 안내문 */
.comment-form-notice {
  font-size: 11px;
  color: var(--text-muted, #6b7280);
  margin: 4px 0 0;
  padding: 0;
  line-height: 1.4;
}

/* 대댓글 └ 마커 */
.reply-marker {
  display: inline-block;
  margin-right: 6px;
  color: var(--text-muted, #9ca3af);
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

/* 대댓글 좌측 들여쓰기/보더 강화 */
.comment-reply {
  margin-left: 32px;
  padding-left: 14px;
  border-left: 3px solid var(--accent, #2563eb);
  margin-top: 8px;
  border-radius: 0 4px 4px 0;
}
body.dark-theme .comment-reply {
  border-left-color: #1f6feb;
}

/* 이전/다음 글 내비 */
.post-nav-row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.post-nav-btn {
  flex: 1 1 180px;
  padding: 10px 14px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  background: var(--bg-card, #f8fafc);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary, #374151);
  text-align: left;
  transition: background var(--transition, 0.15s), border-color var(--transition, 0.15s);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.post-nav-btn:hover {
  border-color: var(--accent, #2563eb);
  background: var(--bg-hover, #f1f5f9);
}
body.dark-theme .post-nav-btn {
  background: #161b22;
  border-color: #30363d;
  color: #c9d1d9;
}
body.dark-theme .post-nav-btn:hover {
  border-color: #58a6ff;
  background: #21262d;
}

.post-nav-prev {
  text-align: left;
}
.post-nav-next {
  text-align: right;
}

.post-nav-title {
  font-weight: 600;
}

/* 다크 테마 — data-theme 기반 */
:root[data-theme="dark"] .best-comments-box {
  background: #161b22;
  border-color: #30363d;
}
:root[data-theme="dark"] .best-comment-item {
  border-color: #30363d;
}
:root[data-theme="dark"] .best-comment-author {
  color: #c9d1d9;
}
:root[data-theme="dark"] .best-comment-body {
  color: #e6edf3;
}
:root[data-theme="dark"] .best-comment-view-btn {
  border-color: #30363d;
  color: #58a6ff;
}
:root[data-theme="dark"] .best-comment-view-btn:hover {
  background: #21262d;
}
:root[data-theme="dark"] .comment-reply {
  border-left-color: #1f6feb;
}
:root[data-theme="dark"] .post-nav-btn {
  background: #161b22;
  border-color: #30363d;
  color: #c9d1d9;
}
:root[data-theme="dark"] .post-nav-btn:hover {
  border-color: #58a6ff;
  background: #21262d;
}
