/* ===== 미니 차트 ===== */
.mini-chart-wrap {
  margin-top: 12px;
  padding: 8px;
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.mini-chart-wrap:hover { border-color: #f45b6966; }
.mini-chart { width: 100%; height: 90px; }
.mini-chart-label { text-align: center; font-size: 10px; color: #484f58; margin-top: 4px; }
.mini-chart-sm {
  width: 90px; height: 40px;
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s;
  display: inline-block;
}
.mini-chart-sm:hover { border-color: #f45b6966; }

/* ===== 차트 모달 ===== */
.chart-modal {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.75);
  z-index: 1000;
  align-items: center; justify-content: center;
}
.chart-modal.show { display: flex; }
.chart-modal-content {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 12px;
  width: 90%; max-width: 900px;
  padding: 20px;
}
.chart-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
  font-size: 16px; font-weight: 700; color: #f0f6fc;
}
.chart-modal-close {
  cursor: pointer; font-size: 24px; color: #8b949e;
  width: 28px; height: 28px; line-height: 26px; text-align: center;
  border-radius: 4px;
}
.chart-modal-close:hover { background: #21262d; color: #f0f6fc; }

/* PDF 출력 시 차트 숨김 */
@media print {
  .mini-chart-wrap, .mini-chart-sm, .chart-modal { display: none !important; }
}

/* ===== 오늘의 특징주 ===== */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 900px) { .featured-grid { grid-template-columns: 1fr; } }
.featured-card {
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 10px;
  padding: 14px 16px;
}
.featured-card.grade-leader { border-color: #ef5350; border-width: 2px; }
.featured-card.grade-strong { border-color: #f0b90b; }
.featured-card.grade-watch { border-color: #f45b69; }
.featured-card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.featured-rank {
  background: #21262d;
  color: #8b949e;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}
.featured-name-wrap { flex: 1; min-width: 0; }
.featured-name {
  color: #f0f6fc;
  font-size: 16px; font-weight: 700;
  cursor: pointer;
}
.featured-name:hover { color: #f45b69; }
.featured-code { color: #8b949e; font-size: 11px; margin-top: 2px; }
.featured-grade-badge {
  font-size: 11px; font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}
.featured-grade-badge.grade-leader { background: #ef535033; color: #ef5350; }
.featured-grade-badge.grade-strong { background: #f0b90b33; color: #f0b90b; }
.featured-grade-badge.grade-watch { background: #f45b6933; color: #f45b69; }
.featured-grade-badge.grade-skip { background: #21262d; color: #8b949e; }
.featured-price-row {
  display: flex; align-items: baseline; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid #21262d;
  margin-bottom: 10px;
}
.featured-price { font-size: 18px; font-weight: 700; }
.featured-change { font-size: 14px; font-weight: 600; }
.featured-score {
  margin-left: auto;
  background: #161b22; color: #c9d1d9;
  padding: 3px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600;
}
.featured-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; margin-bottom: 10px;
}
.featured-stats > div { display: flex; flex-direction: column; }
.featured-stats .label { color: #8b949e; font-size: 10px; margin-bottom: 2px; }
.featured-stats .value { color: #c9d1d9; font-size: 12px; font-weight: 600; }
.featured-stats .value.check { color: #2ea043; }
.featured-news { border-top: 1px solid #21262d; padding-top: 8px; }
.featured-news-title { color: #8b949e; font-size: 11px; margin-bottom: 4px; }
.featured-news-item {
  display: block;
  color: #c9d1d9; font-size: 12px;
  padding: 3px 0;
  text-decoration: none;
}
.featured-news-item:hover { color: #f45b69; text-decoration: underline; }

/* ===== 선제매수 포착 ===== */
/* 주목 테마 카드 전용 그리드 */
.early-theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.early-theme-card {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 10px;
  padding: 16px 18px 14px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}
.early-theme-card:hover { border-color: #f45b69; }
.early-theme-rank {
  position: absolute;
  top: 8px;
  right: 14px;
  font-size: 40px;
  font-weight: 900;
  color: rgba(88, 166, 255, 0.08);
  line-height: 1;
}
.early-theme-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.early-theme-name {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.early-theme-meta {
  font-size: 11px;
  color: #6e7681;
  margin-bottom: 10px;
}
.early-theme-stats {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid #21262d;
  border-bottom: 1px solid #21262d;
  margin-bottom: 10px;
}
.early-theme-stat {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.early-theme-stat-label { font-size: 10px; color: #6e7681; margin-bottom: 2px; }
.early-theme-stat-value { font-size: 13px; font-weight: 600; }
.early-theme-stocks-header {
  display: grid;
  grid-template-columns: 1fr 58px 68px;
  gap: 4px;
  font-size: 10px;
  color: #6e7681;
  padding: 0 0 4px 0;
  border-bottom: 1px solid rgba(33,38,45,0.6);
  margin-bottom: 2px;
}
.early-theme-stocks-header span:nth-child(2),
.early-theme-stocks-header span:nth-child(3) { text-align: right; }
.early-theme-stock-row {
  display: grid;
  grid-template-columns: 1fr 58px 68px;
  gap: 4px;
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
  border-bottom: 1px solid rgba(33,38,45,0.3);
}
.early-theme-stock-row:last-child { border-bottom: none; }
.early-stock-name {
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.early-stock-name:hover { color: #f45b69; }
.early-stock-chg { text-align: right; font-weight: 600; font-size: 12px; }
.early-stock-vol { text-align: right; color: #8b949e; font-size: 11px; }
.tech-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.badge-tech-aligned { background: #1a3a2a; color: #3fb950; }
.badge-tech-near_aligned { background: #2a3a1a; color: #a3e635; }
.badge-tech-bounce { background: #3b2a1a; color: #f0883e; }
.badge-tech-accumulating { background: #3f1f2a; color: #f45b69; }
.buy-badge { display:inline-block;padding:2px 8px;border-radius:4px;font-size:11px;font-weight:600; }
.badge-buy-both { background: #1a3a2a; color: #3fb950; }
.badge-buy-foreign { background: #3f1f2a; color: #f45b69; }
.badge-buy-inst { background: #3b2a1a; color: #f0883e; }
.badge-buy-volume { background: #2a2a3b; color: #a78bfa; }
.theme-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.theme-tag { display: inline-block; padding: 2px 7px; border-radius: 3px; font-size: 11px; background: #1c2333; color: #8b949e; border: 1px solid #21262d; white-space: nowrap; }
.bounce-low { color: #3fb950; font-weight: 600; }
.bounce-mid { color: #d29922; font-weight: 600; }
.bounce-high { color: #f85149; font-weight: 600; }

/* ===== 상승 기대 종목 점수 뱃지 ===== */
.rising-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}
.score-hot { background: #ef535033; color: #ef5350; }
.score-warm { background: #f0b90b33; color: #f0b90b; }
.score-mid { background: #f45b6933; color: #f45b69; }
.score-low { background: #21262d; color: #8b949e; }
.momentum-hot { background: #ef535022; color: #ef5350; padding: 2px 6px; border-radius: 3px; font-size: 11px; font-weight: 600; }
.momentum-rising { background: #f0b90b22; color: #f0b90b; padding: 2px 6px; border-radius: 3px; font-size: 11px; font-weight: 600; }
.momentum-none { background: #21262d; color: #484f58; padding: 2px 6px; border-radius: 3px; font-size: 11px; font-weight: 600; }

/* ===== 대시보드 트렌드/투자자 카드 ===== */
.trends-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  border-bottom: 1px solid #21262d;
  padding-bottom: 8px;
}
.trends-tab {
  background: #161b22;
  color: #8b949e;
  border: 1px solid #21262d;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.trends-tab:hover { color: #c9d1d9; border-color: #30363d; }
.trends-tab.active {
  background: #1565c033;
  color: #f45b69;
  border-color: #f45b6966;
  font-weight: 600;
}
.trend-dashboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.trend-dashboard-table th {
  text-align: left;
  color: #8b949e;
  font-size: 11px;
  font-weight: 500;
  padding: 8px 10px;
  border-bottom: 1px solid #21262d;
  white-space: nowrap;
}
.trend-dashboard-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #161b2240;
  color: #c9d1d9;
  vertical-align: middle;
}
.trend-dashboard-table tr:hover td { background: #161b22; }
.trend-dashboard-table .td-rank { color: #8b949e; font-weight: 600; width: 40px; }
.trend-dashboard-table .td-num { text-align: right; font-weight: 500; }
.trend-dashboard-table .td-stocks { color: #8b949e; font-size: 12px; }
.cat-badge-dash {
  display: inline-block;
  background: #1565c033;
  color: #f45b69;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

/* PDF 전용 영역 (화면 숨김) */
.print-only { display: none; }
.report-date-info { display: none; }
.print-page-title {
  font-size: 14px; font-weight: 800; color: #e1e4e8;
  margin-bottom: 12px; padding-bottom: 6px; border-bottom: 2px solid #30363d;
}

/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0f1117;
  color: #e1e4e8;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

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

/* Sidebar */
.sidebar {
  width: 220px;
  min-width: 220px;
  background: #161b22;
  border-right: 1px solid #21262d;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
}
.sidebar-logo {
  padding: 0 20px 24px;
  border-bottom: 1px solid #21262d;
  margin-bottom: 16px;
}
.sidebar-logo h1 {
  font-size: 18px;
  font-weight: 700;
  color: #f45b69;
}
.sidebar-logo span {
  font-size: 11px;
  color: #8b949e;
  display: block;
  margin-top: 4px;
}
.sidebar nav { flex: none; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  font-size: 14px;
  color: #8b949e;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}
.sidebar nav a:hover { color: #e1e4e8; background: #1c2128; }
.sidebar nav a.active {
  color: #f45b69;
  background: #1c2128;
  border-left-color: #f45b69;
}
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid #21262d;
  font-size: 11px;
  color: #484f58;
}

/* 서비스 전환 링크 */
.sidebar-switch {
  padding: 12px 12px 4px;
  border-top: 1px solid #21262d;
}
.sidebar-switch a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #8b949e;
  text-decoration: none;
  transition: all 0.2s;
}
.sidebar-switch a:hover {
  background: rgba(255,255,255,0.05);
  color: #d0d4dc;
}
.sidebar-switch a svg { opacity: 0.6; }
.sidebar-switch a:hover svg { opacity: 1; }

/* Main Content */
.main {
  flex: 1;
  padding: 32px;
  max-width: 1200px;
}

/* ===== Header ===== */
.page-header {
  margin-bottom: 28px;
}
.page-header h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}
.page-header p {
  font-size: 13px;
  color: #8b949e;
}
.market-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 6px;
}
.badge-kospi { background: #3f1f2a; color: #f45b69; }
.badge-kosdaq { background: #3b1f3f; color: #d2a8ff; }

/* ===== Cards ===== */
.card {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.card-title {
  font-size: 16px;
  font-weight: 700;
}

/* ===== Leader Cards (Main 3) ===== */
.leader-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.leader-card {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 12px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}
.leader-card:hover { border-color: #f45b69; }
.leader-rank {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 48px;
  font-weight: 900;
  color: rgba(88, 166, 255, 0.1);
  line-height: 1;
}
.leader-market {
  font-size: 11px;
  color: #8b949e;
  margin-bottom: 4px;
}
.leader-name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 2px;
}
.leader-code {
  font-size: 12px;
  color: #484f58;
  margin-bottom: 16px;
}
.leader-price {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}
.leader-change {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
}
.up { color: #f85149; }
.down { color: #3b82f6; }
.leader-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid #21262d;
}
.leader-stat-label {
  font-size: 11px;
  color: #8b949e;
}
.leader-stat-value {
  font-size: 14px;
  font-weight: 600;
}
.leader-badges {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.leader-badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.badge-align { background: #1a3a2a; color: #3fb950; }
.badge-bounce { background: #3b2a1a; color: #f0883e; }
.badge-volume { background: #3f1f2a; color: #f45b69; }

/* Score Bar */
.score-bar-wrap {
  margin-top: 14px;
}
.score-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #8b949e;
  margin-bottom: 4px;
}
.score-bar {
  height: 6px;
  background: #21262d;
  border-radius: 3px;
  overflow: hidden;
}
.score-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #f45b69, #ff8c42);
}

/* ===== Sub Leader Table ===== */
.sub-table {
  width: 100%;
  border-collapse: collapse;
}
.sub-table th {
  text-align: left;
  font-size: 12px;
  color: #8b949e;
  font-weight: 500;
  padding: 10px 12px;
  border-bottom: 1px solid #21262d;
}
.sub-table td {
  padding: 12px;
  font-size: 14px;
  border-bottom: 1px solid #21262d;
}
.sub-table tr:hover { background: #1c2128; }
.sub-rank {
  width: 40px;
  font-weight: 700;
  color: #8b949e;
}
.sub-name-wrap { display: flex; flex-direction: column; }
.sub-name { font-weight: 600; }
.sub-code { font-size: 11px; color: #484f58; }
.check { color: #3fb950; }

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: #0d1117;
  padding: 4px;
  border-radius: 8px;
  width: fit-content;
}
.tab {
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #8b949e;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: none;
}
.tab:hover { color: #e1e4e8; }
.tab.active {
  background: #21262d;
  color: #e1e4e8;
}

.filter-tab {
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #8b949e;
  cursor: pointer;
  border: 1px solid #30363d;
  background: none;
  transition: all 0.15s;
}
.filter-tab:hover { color: #e1e4e8; border-color: #484f58; }
.filter-tab.active { background: #21262d; color: #e1e4e8; border-color: #f45b69; }

/* ===== Filters ===== */
.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  border: 1px solid #21262d;
  background: #161b22;
  color: #8b949e;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-chip.active {
  border-color: #f45b69;
  color: #f45b69;
  background: #3f1f2a;
}
.filter-chip input[type="checkbox"] { display: none; }
.filter-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #484f58;
}
.filter-chip.active .filter-dot { background: #f45b69; }

/* Date Picker */
.date-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.date-input {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #21262d;
  background: #0d1117;
  color: #e1e4e8;
  font-size: 13px;
}

/* ===== Volume Table ===== */
.vol-table {
  width: 100%;
  border-collapse: collapse;
}
.vol-table th {
  text-align: left;
  font-size: 12px;
  color: #8b949e;
  font-weight: 500;
  padding: 10px 12px;
  border-bottom: 1px solid #21262d;
  cursor: pointer;
  user-select: none;
}
.vol-table th:hover { color: #e1e4e8; }
.vol-table td {
  padding: 12px;
  font-size: 14px;
  border-bottom: 1px solid #21262d;
}
.vol-table tr:hover { background: #1c2128; }
.vol-table .rank { width: 50px; color: #8b949e; font-weight: 700; }
.vol-table .align-right { text-align: right; }

/* ===== Sector ===== */
.sector-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sector-row-wrap {
  border-bottom: 1px solid #21262d;
}
.sector-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sector-toggle {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #484f58;
  font-size: 14px;
  flex-shrink: 0;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.sector-toggle:hover { background: #21262d; color: #c9d1d9; }
.sector-toggle.open { color: #f45b69; }
.sector-stocks-panel {
  display: none;
  padding: 6px 0 8px 34px;
}
.sector-stocks-panel.show { display: block; }
.sector-stock-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  font-size: 13px;
  border-radius: 4px;
}
.sector-stock-item:hover { background: #161b22; }
.sector-stock-item .stock-rank { color: #484f58; font-size: 11px; width: 18px; text-align: right; }
.sector-stock-item .stock-name { cursor: pointer; color: #c9d1d9; font-weight: 500; }
.sector-stock-item .stock-name:hover { color: #f45b69; }
.sector-stock-item .stock-change { margin-left: auto; font-size: 12px; font-weight: 600; }
.sector-stock-item .stock-value { color: #484f58; font-size: 11px; width: 60px; text-align: right; }
.sector-name {
  width: 90px;
  font-size: 13px;
  font-weight: 500;
  text-align: right;
  flex-shrink: 0;
}
.sector-bar-bg {
  flex: 1;
  height: 28px;
  background: #21262d;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.sector-bar-fill {
  height: 100%;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding-left: 10px;
  font-size: 12px;
  font-weight: 600;
  min-width: 40px;
}
.sector-bar-fill.positive { background: linear-gradient(90deg, #f8514933, #f8514966); color: #f85149; }
.sector-bar-fill.negative { background: linear-gradient(90deg, #3b82f633, #3b82f666); color: #3b82f6; }
.sector-volume {
  width: 90px;
  text-align: right;
  font-size: 12px;
  color: #8b949e;
  flex-shrink: 0;
}
.sector-highlight { background: rgba(88, 166, 255, 0.05); border-radius: 6px; padding: 4px 0; }

/* Sector Summary Cards */
.sector-summary-grid,
#sector-summary-cards {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 14px !important;
}
.sector-summary-card {
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 10px;
  padding: 0;
  margin-bottom: 0;
  overflow: hidden;
}
.sector-summary-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #21262d;
  flex-wrap: wrap;
}
.sector-summary-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #3f1f2a;
  color: #f45b69;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.sector-summary-name {
  font-size: 16px;
  font-weight: 700;
}
.sector-summary-change {
  font-size: 15px;
  font-weight: 700;
}
.sector-summary-meta {
  font-size: 12px;
  color: #8b949e;
  margin-left: auto;
}
.sector-stock-table {
  width: 100%;
  border-collapse: collapse;
}
.sector-stock-table th {
  text-align: left;
  font-size: 11px;
  color: #8b949e;
  font-weight: 500;
  padding: 6px 8px;
  border-bottom: 1px solid #21262d;
}
.sector-stock-table td {
  padding: 6px 8px;
  font-size: 12px;
  border-bottom: 1px solid #161b2210;
}
.sector-stock-table tr:hover { background: #161b22; }
.sector-stock-table .rank { width: 24px; color: #8b949e; font-weight: 600; }

/* Sector History Table */
.sector-history {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}
.sector-history th {
  text-align: left;
  font-size: 12px;
  color: #8b949e;
  padding: 10px 12px;
  border-bottom: 1px solid #21262d;
}
.sector-history td {
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid #21262d;
}

/* Heatmap */
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 16px;
}
.heatmap-cell {
  padding: 14px 10px;
  border-radius: 8px;
  text-align: center;
  font-size: 12px;
}
.heatmap-cell .sector { font-weight: 600; margin-bottom: 4px; }
.heatmap-cell .pct { font-size: 14px; font-weight: 700; }
.heat-5 { background: #f8514933; color: #f85149; }
.heat-4 { background: #f8514922; color: #f87171; }
.heat-3 { background: #f8514915; color: #fca5a5; }
.heat-2 { background: #f851490a; color: #e1e4e8; }
.heat-1 { background: #21262d; color: #8b949e; }
.heat-0 { background: #3b82f60a; color: #8b949e; }
.heat-n1 { background: #3b82f615; color: #93c5fd; }
.heat-n2 { background: #3b82f633; color: #3b82f6; }

/* ===== Update Time ===== */
.update-time {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #484f58;
}
.update-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #3fb950;
}

/* ===== Date Navigator ===== */
.date-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 12px;
  padding: 12px 20px;
}
.date-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #21262d;
  background: #0d1117;
  color: #e1e4e8;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.date-nav-btn:hover { background: #21262d; border-color: #f45b69; }
.date-today-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid #f45b69;
  background: #3f1f2a;
  color: #f45b69;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.date-today-btn:hover { background: #f45b69; color: #fff; }
.date-nav-current {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: center;
}
.date-nav-date {
  font-size: 18px;
  font-weight: 700;
}
.date-nav-day {
  font-size: 13px;
  color: #8b949e;
}
.date-nav input[type="date"] {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #21262d;
  background: #0d1117;
  color: #e1e4e8;
  font-size: 13px;
  cursor: pointer;
}

/* ===== Copyable Name ===== */
.copyable {
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}
.copyable:hover { color: #f45b69; }
.copy-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #3fb950;
  color: #0d1117;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
  z-index: 1000;
}
.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== Sector/Theme Badge ===== */
.badge-sector {
  background: #1a2a3a;
  color: #79c0ff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-theme {
  background: #2a1a2a;
  color: #d2a8ff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

/* ===== PDF Button ===== */
.pdf-btn {
  padding: 8px 18px;
  border-radius: 8px;
  border: 1px solid #21262d;
  background: #161b22;
  color: #8b949e;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.pdf-btn:hover { background: #21262d; color: #e1e4e8; border-color: #f45b69; }
.pdf-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Refresh Button */
.refresh-btn {
  padding: 8px 18px;
  border-radius: 8px;
  border: 1px solid #3fb950;
  background: #1a3a2a;
  color: #3fb950;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.refresh-btn:hover { background: #3fb950; color: #fff; }
.refresh-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== Sector Leaders Grid ===== */
.sector-leaders-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.sector-leader-card {
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 10px;
  padding: 14px;
}
.sector-leader-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid #21262d;
}
.sector-leader-rank {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #3f1f2a;
  color: #f45b69;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.sector-leader-name {
  font-size: 14px;
  font-weight: 700;
}
.sector-leader-stock {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}
.sector-leader-stock-rank {
  font-size: 11px;
  color: #484f58;
  width: 14px;
  flex-shrink: 0;
}
.sector-leader-stock-name {
  font-size: 13px;
  font-weight: 500;
}

/* ===== News List ===== */
.news-list {
  display: flex;
  flex-direction: column;
}
.news-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #21262d;
  text-decoration: none;
  color: #e1e4e8;
  transition: background 0.2s;
}
.news-item:last-child { border-bottom: none; }
.news-item:hover { background: #1c2128; border-radius: 6px; padding-left: 8px; padding-right: 8px; }
.news-stock-badge {
  background: #3f1f2a;
  color: #f45b69;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.news-title {
  font-size: 14px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.news-group-header {
  padding: 10px 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: #f45b69;
  border-bottom: 1px solid #21262d;
  margin-top: 8px;
}
.news-group-header:first-child { margin-top: 0; }
.news-num {
  display: none;
}
.news-link-url {
  display: none;
}
.news-arrow {
  color: #484f58;
  font-size: 14px;
  flex-shrink: 0;
}

/* ===== Copyright Footer ===== */
.copyright-footer {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 24px;
  padding: 20px 24px;
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 12px;
}
.copyright-logo img {
  display: block;
}
.copyright-text {
  font-size: 13px;
  color: #8b949e;
  line-height: 1.7;
}
.copyright-text strong {
  color: #e1e4e8;
}
.copyright-text a {
  color: #f45b69;
  text-decoration: none;
}
.copyright-text a:hover {
  text-decoration: underline;
}

/* ===== Print Header (화면에서 숨김) ===== */
.print-header { display: none; }

/* ===== Mobile Hamburger ===== */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 48px;
  background: #161b22;
  border-bottom: 1px solid #21262d;
  z-index: 900;
  align-items: center;
  padding: 0 12px;
  gap: 12px;
}
.mobile-hamburger {
  width: 36px; height: 36px;
  background: none; border: 1px solid #30363d; border-radius: 6px;
  color: #e1e4e8; font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.mobile-hamburger:hover { background: #21262d; }
.mobile-header-title {
  font-size: 15px; font-weight: 700; color: #f45b69;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 999;
}
.sidebar-overlay.show { display: block; }

/* ===== Responsive (screen only — 인쇄 영향 없음) ===== */
@media screen and (max-width: 1024px) {
  .mobile-header { display: flex; }
  .sidebar {
    display: flex;
    position: fixed;
    top: 0; left: -260px;
    width: 250px;
    z-index: 1000;
    transition: left 0.25s ease;
  }
  .sidebar.open { left: 0; }
  .main { margin-left: 0; padding-top: 60px; }
  .leader-grid { grid-template-columns: repeat(2, 1fr); }
  .early-theme-grid { grid-template-columns: repeat(2, 1fr); }
  .heatmap-grid { grid-template-columns: repeat(3, 1fr); }
  .sector-leaders-grid { grid-template-columns: repeat(2, 1fr); }
  .sector-summary-grid,
  #sector-summary-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .sub-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .vol-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .trend-dashboard-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .page-header h2 { font-size: 18px; }
  .main { padding: 60px 16px 24px; }
}
@media screen and (max-width: 768px) {
  .leader-grid { grid-template-columns: 1fr; max-width: 480px; }
  .leader-card { padding: 16px; }
  .leader-price { font-size: 20px; }
  .leader-name { font-size: 17px; }
  .leader-stats { grid-template-columns: repeat(4, 1fr); }
  .mini-chart-wrap { height: auto; }
  .mini-chart { height: 70px; }
  .date-nav { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .date-nav-date { font-size: 15px; }
  .date-nav-current { gap: 8px; }
  .page-header .pdf-btn,
  .page-header .refresh-btn { font-size: 11px; padding: 6px 10px; }
  .card { padding: 16px; }
  .card-header { flex-wrap: wrap; gap: 8px; }
  .featured-grid { grid-template-columns: 1fr; }
  .sector-summary-grid,
  #sector-summary-cards { grid-template-columns: 1fr !important; }
  .sector-leaders-grid { grid-template-columns: 1fr; }
  .early-theme-grid { grid-template-columns: 1fr; }
  .copyright-footer { flex-direction: column; text-align: center; gap: 12px; }
}
@media screen and (max-width: 480px) {
  .main { padding: 56px 10px 16px; }
  .card { padding: 12px; margin-bottom: 12px; }
  .leader-card { padding: 14px; }
  .leader-price { font-size: 18px; }
  .leader-stats { grid-template-columns: 1fr 1fr; gap: 6px; }
  .date-nav { padding: 8px 10px; }
  .date-nav-btn { width: 30px; height: 30px; font-size: 15px; }
  .date-nav-date { font-size: 14px; }
  .trends-tabs { gap: 4px; }
  .trends-tab { padding: 5px 8px; font-size: 11px; }
  .featured-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Print (PDF) ===== */
@media print {
  @page { size: A4; margin: 8mm 10mm; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

  /* 레이아웃 초기화 */
  body { background: #fff !important; color: #222 !important; font-size: 8pt !important; line-height: 1.3 !important; }
  .sidebar, .pdf-btn, .refresh-btn, .date-nav-btn, .date-today-btn, .date-nav input[type="date"], .copy-toast { display: none !important; }

  /* PDF 상단 헤더 (로고 + 저작권 우측) */
  .print-header {
    display: flex !important;
    align-items: center;
    gap: 14px;
    padding: 6px 10px;
    margin-bottom: 6px;
    border-bottom: 2px solid #222;
  }
  .print-header-logo { height: 36px; flex-shrink: 0; }
  .print-header-info {
    font-size: 9pt; color: #333; line-height: 1.4;
    flex: 1;
  }
  .print-header-info strong { color: #111; }
  .print-header-info a { color: #1565c0; text-decoration: none; }
  .print-header-copyright {
    display: block !important;
    color: #666 !important;
    font-size: 6.5pt !important;
    line-height: 1.3 !important;
    text-align: right !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }
  .print-header-copyright a { color: #1565c0 !important; text-decoration: none !important; }

  /* 뉴스 - 섹터 주도주 바로 이어서 */
  .print-page2 {
    page-break-before: auto !important;
    padding: 12px 14px !important;
  }
  .print-page2 .card-header { margin-bottom: 8px !important; }
  .print-page2 .card-title { font-size: 13pt !important; font-weight: 800 !important; }
  .app { display: block !important; }
  .main { margin-left: 0 !important; padding: 0 !important; max-width: 100% !important; width: 100% !important; }

  /* 카드 - 압축 */
  .card {
    background: #fff !important; border: 1px solid #ccc !important;
    padding: 6px 10px !important; margin-bottom: 6px !important;
    box-shadow: none !important; border-radius: 4px !important;
  }
  .card-header { margin-bottom: 4px !important; }
  .card-title { color: #111 !important; font-size: 10pt !important; }

  /* 헤더 - 중앙정렬, 크게 */
  .page-header { margin-bottom: 8px !important; text-align: center !important; justify-content: center !important; }
  .page-header h2 { color: #111 !important; font-size: 18pt !important; font-weight: 800 !important; margin-bottom: 4px !important; }
  .page-header p { color: #666 !important; font-size: 9pt !important; }

  /* 날짜 - 작게 */
  .date-nav { background: #f0f0f0 !important; border: 1px solid #ccc !important; padding: 4px 12px !important; margin-bottom: 6px !important; border-radius: 4px !important; }
  .date-nav-date { color: #111 !important; font-size: 10pt !important; }
  .date-nav-day { color: #666 !important; font-size: 8pt !important; }
  .date-nav-current { gap: 6px !important; }

  /* 색상 */
  .up { color: #c62828 !important; }
  .down { color: #1565c0 !important; }
  .check { color: #2e7d32 !important; }

  /* TOP3 주도주 카드 - 가로 3열 유지, 압축 */
  .leader-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
    margin-bottom: 0 !important;
  }
  .leader-card {
    background: #fff !important; border: 1px solid #ccc !important;
    padding: 8px !important; border-radius: 4px !important;
    overflow: hidden !important;
  }
  .leader-name { color: #111 !important; font-size: 9pt !important; margin-bottom: 0 !important; }
  .leader-code { color: #888 !important; font-size: 7pt !important; margin-bottom: 6px !important; }
  .leader-price { color: #111 !important; font-size: 10pt !important; margin-bottom: 1px !important; }
  .leader-change { font-size: 8pt !important; margin-bottom: 6px !important; }
  .leader-rank { font-size: 28px !important; }
  .leader-market { font-size: 7pt !important; margin-bottom: 2px !important; }
  .leader-stats { border-top: 1px solid #ddd !important; padding-top: 4px !important; gap: 3px !important; }
  .leader-stat-label { color: #888 !important; font-size: 6.5pt !important; }
  .leader-stat-value { color: #222 !important; font-size: 7.5pt !important; }
  .leader-badges { margin-top: 4px !important; gap: 3px !important; }
  .leader-badge { font-size: 6.5pt !important; padding: 1px 4px !important; }
  .score-bar-wrap { margin-top: 4px !important; }
  .score-bar { background: #ddd !important; height: 4px !important; }
  .score-fill { background: linear-gradient(90deg, #1565c0, #2e7d32) !important; }
  .score-label { color: #888 !important; font-size: 6.5pt !important; margin-bottom: 2px !important; }

  /* 뱃지 */
  .badge-align { background: #e8f5e9 !important; color: #2e7d32 !important; }
  .badge-bounce { background: #fff3e0 !important; color: #e65100 !important; }
  .badge-volume { background: #e3f2fd !important; color: #1565c0 !important; }
  .market-badge { border: 1px solid #ccc !important; font-size: 6.5pt !important; padding: 1px 4px !important; }
  .badge-kospi { background: #e3f2fd !important; color: #1565c0 !important; }
  .badge-kosdaq { background: #f3e5f5 !important; color: #7b1fa2 !important; }
  .badge-sector { background: #e3f2fd !important; color: #1565c0 !important; font-size: 6.5pt !important; }

  /* 서브 주도주 테이블 */
  .sub-table {
    font-size: 6.5pt !important;
    table-layout: fixed !important;
    width: 100% !important;
  }
  .sub-table th, .sub-table td {
    color: #222 !important;
    border-bottom: 1px solid #eee !important;
    padding: 2px 3px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .sub-table th {
    color: #666 !important;
    border-bottom: 1px solid #ccc !important;
    font-size: 6pt !important;
    font-weight: 600 !important;
    text-align: center !important;
  }
  .sub-table td:nth-child(5),
  .sub-table td:nth-child(6),
  .sub-table td:nth-child(7),
  .sub-table td:nth-child(8) {
    text-align: right !important;
    font-size: 6.5pt !important;
  }
  .sub-table td:nth-child(9),
  .sub-table td:nth-child(10),
  .sub-table td:nth-child(11) {
    text-align: center !important;
  }
  /* 차트 컬럼 인쇄 숨김 */
  .sub-table th:last-child, .sub-table td:last-child { display: none !important; }
  .sub-rank { color: #888 !important; text-align: center !important; }
  .sub-name-wrap { display: block !important; line-height: 1.2 !important; }
  .sub-name { color: #111 !important; font-size: 6.5pt !important; }
  .sub-code { color: #888 !important; font-size: 5.5pt !important; }

  /* 섹터 바 - 압축 */
  .sector-bar-chart { gap: 3px !important; }
  .sector-row { padding: 1px 0 !important; }
  .sector-name { color: #222 !important; font-size: 7pt !important; width: 65px !important; }
  .sector-bar-bg { background: #eee !important; height: 18px !important; }
  .sector-bar-fill { font-size: 7pt !important; min-width: 30px !important; padding-left: 6px !important; }
  .sector-bar-fill.positive { background: #ffcdd2 !important; color: #c62828 !important; }
  .sector-bar-fill.negative { background: #bbdefb !important; color: #1565c0 !important; }
  .sector-volume { color: #666 !important; font-size: 7pt !important; width: 60px !important; }
  .sector-highlight { background: #f5f5f5 !important; padding: 2px 0 !important; }

  /* 섹터별 주도주 카드 - 3열 */
  .sector-leaders-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 4px !important;
  }
  .sector-leader-card {
    background: #fff !important; border: 1px solid #ccc !important;
    padding: 5px 7px !important; border-radius: 3px !important;
  }
  .sector-leader-header { border-bottom: 1px solid #ddd !important; padding-bottom: 3px !important; margin-bottom: 3px !important; gap: 4px !important; }
  .sector-leader-rank { background: #e3f2fd !important; color: #1565c0 !important; width: 16px !important; height: 16px !important; font-size: 7pt !important; }
  .sector-leader-name { color: #111 !important; font-size: 8pt !important; }
  .sector-leader-stock-name { color: #222 !important; font-size: 7pt !important; }
  .sector-leader-stock { padding: 2px 0 !important; gap: 4px !important; }
  .sector-leader-stock-rank { font-size: 6.5pt !important; }

  /* 뉴스 - 한 페이지에 압축 */
  .print-page2 { page-break-inside: avoid !important; }
  .news-group {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    margin-bottom: 2px !important;
  }
  .news-group-header {
    color: #111 !important; font-size: 7.5pt !important; font-weight: 800 !important;
    border-bottom: 1px solid #999 !important; padding: 2px 0 1px !important;
    margin-top: 2px !important;
    page-break-after: avoid !important;
  }
  .news-group-header:first-child { margin-top: 0 !important; }
  .news-list { gap: 0 !important; }
  .news-item {
    color: #222 !important; border-bottom: 1px solid #eee !important;
    padding: 1px 0 !important; text-decoration: none !important;
    display: flex !important; gap: 4px !important; align-items: flex-start !important;
    flex-wrap: nowrap !important;
    line-height: 1.25 !important;
    page-break-inside: avoid !important;
  }
  .news-num {
    display: inline-block !important;
    color: #888 !important; font-size: 6.5pt !important; font-weight: 700 !important;
    width: 14px !important; flex-shrink: 0 !important;
  }
  .news-stock-badge { display: none !important; }
  .news-title {
    color: #1565c0 !important; white-space: normal !important;
    font-size: 7pt !important; font-weight: 500 !important; flex: 1 !important;
    text-decoration: underline !important;
    line-height: 1.25 !important;
  }
  .news-link-url { display: none !important; }
  .news-arrow { display: none !important; }

  /* 업데이트 시간 */
  .update-time { font-size: 7pt !important; color: #888 !important; }
  .update-dot { background: #2e7d32 !important; width: 4px !important; height: 4px !important; }

  /* 종합보고서 PDF 전용: 대시보드의 중복 섹션 숨김 */
  body.printing-report .sector-summary-card-wrap { display: none !important; }
  body.printing-report .dashboard-only-card { display: none !important; }

  /* TOP 6 연속 흐름 - 페이지 여백 최소화 */
  body.printing-report .print-only.active .print-flow {
    margin: 0 !important; padding: 0 !important;
  }
  body.printing-report .print-only.active .print-flow .print-page-title {
    font-size: 11pt !important;
    margin: 0 0 4px !important;
    padding-bottom: 3px !important;
    border-bottom: 1.5px solid #1565c0 !important;
    page-break-after: avoid !important;
  }
  body.printing-report .print-only.active .sector-leaders-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 4px !important;
    margin-bottom: 4px !important;
  }
  body.printing-report .print-only.active .sector-leader-card {
    background: #fff !important;
    border: 1px solid #bbb !important;
    border-radius: 3px !important;
    padding: 4px 6px !important;
    page-break-inside: avoid !important;
  }
  body.printing-report .print-only.active .sector-leader-header {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding-bottom: 2px !important;
    margin-bottom: 3px !important;
    border-bottom: 1px solid #ddd !important;
  }
  body.printing-report .print-only.active .sector-leader-rank {
    background: #e3f2fd !important; color: #1565c0 !important;
    width: 13px !important; height: 13px !important;
    border-radius: 50% !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    font-size: 6pt !important; font-weight: 700 !important;
    flex-shrink: 0 !important;
  }
  body.printing-report .print-only.active .sector-leader-name {
    color: #111 !important; font-size: 7.5pt !important; font-weight: 700 !important;
    white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important;
  }
  body.printing-report .print-only.active .sector-leader-stock {
    display: flex !important; align-items: center !important; gap: 3px !important;
    padding: 1px 0 !important; line-height: 1.2 !important;
  }
  body.printing-report .print-only.active .sector-leader-stock-rank {
    color: #888 !important; font-size: 5.5pt !important; width: 10px !important;
  }
  body.printing-report .print-only.active .sector-leader-stock-name {
    color: #222 !important; font-size: 6.5pt !important; font-weight: 500 !important;
    white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important;
  }

  /* 종합보고서 첫 페이지: 기준일 + 발행일시 */
  body.printing-report .report-date-info {
    display: block !important;
    color: #333 !important;
    font-size: 9pt !important;
    font-weight: 600 !important;
    margin: 4px 0 6px !important;
    padding: 4px 10px !important;
    background: #f5f5f5 !important;
    border-left: 3px solid #1565c0 !important;
    border-radius: 2px !important;
  }
  body.printing-report .report-date-label {
    color: #666 !important;
    font-weight: 500 !important;
    margin-right: 2px !important;
  }

  /* 섹터별 주도주 TOP 6 - 새 페이지로 */
  .print-page-break { page-break-before: always !important; }

  /* PDF 인쇄: 뉴스는 주도주 순위 TOP 15까지만 (한 페이지 가득 차게) */
  .news-group[data-rank="16"],
  .news-group[data-rank="17"],
  .news-group[data-rank="18"],
  .news-group[data-rank="19"],
  .news-group[data-rank="20"],
  .news-group[data-rank="21"],
  .news-group[data-rank="22"],
  .news-group[data-rank="23"] { display: none !important; }

  /* 섹터 토글/필터/탭 - 인쇄 숨김 */
  .sector-toggle, .sector-stocks-panel { display: none !important; }
  .sector-row-wrap { border: none !important; background: #fff !important; }
  .filters { display: none !important; }
  .tabs { display: none !important; }
  #tab-weekly, #tab-monthly { display: none !important; }

  /* 섹터 바 차트 - 인쇄 숨김 */
  .sector-bar-chart { display: none !important; }

  /* PDF 전용 영역 */
  .print-only.active { display: block !important; }
  /* active 시 기존 화면 콘텐츠 전부 숨김 */
  #tab-daily, #tab-weekly, #tab-monthly { display: none !important; }
  .date-nav { display: none !important; }

  .print-page-title {
    font-size: 14pt !important; font-weight: 800 !important; color: #111 !important;
    margin-bottom: 10px !important; padding-bottom: 6px !important;
    border-bottom: 2px solid #333 !important;
  }
  .print-page .sector-summary-card {
    background: #fff !important;
    border: 1px solid #bbb !important;
  }
  .print-page .sector-summary-header {
    background: #f0f0f0 !important;
    border-bottom: 1px solid #ccc !important;
  }
  .print-page .sector-summary-rank {
    background: #e3f2fd !important; color: #1565c0 !important;
  }
  .print-page .sector-summary-name { color: #111 !important; }
  .print-page .sector-summary-change { color: #222 !important; }
  .print-page .sector-summary-meta { color: #666 !important; }
  .print-page .sector-stock-table { background: #fff !important; }
  .print-page .sector-stock-table th {
    color: #555 !important; background: #fafafa !important;
    border-bottom: 1px solid #ccc !important;
    padding: 3px 4px !important; font-size: 6.5pt !important;
  }
  .print-page .sector-stock-table td {
    color: #222 !important; background: #fff !important;
    border-bottom: 1px solid #eee !important;
    padding: 2px 4px !important; font-size: 7pt !important;
  }
  .print-page .sector-stock-table tr:hover { background: #fff !important; }
  .print-page .up { color: #c62828 !important; }
  .print-page .down { color: #1565c0 !important; }

  /* 테마 트렌드 (1일/1주/2주 + 종목 상세) */
  .trends-period-section {
    margin-bottom: 6px !important;
    page-break-inside: avoid !important;
  }
  .trends-period-title {
    font-size: 9.5pt !important;
    font-weight: 800 !important;
    color: #fff !important;
    margin: 0 0 3px !important;
    padding: 3px 8px !important;
    background: #1565c0 !important;
    border-radius: 3px !important;
  }
  .trend-cols {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }
  .trend-col {
    border: 1px solid #ddd !important;
    border-radius: 3px !important;
    background: #fff !important;
  }
  .trend-col-header {
    background: #f5f5f5 !important;
    color: #333 !important;
    font-size: 8pt !important;
    font-weight: 700 !important;
    padding: 3px 6px !important;
    border-bottom: 1px solid #ccc !important;
  }
  .trend-theme-block {
    border-bottom: 1px solid #eee !important;
    padding: 3px 6px !important;
  }
  .trend-theme-block:last-child { border-bottom: none !important; }
  .trend-theme-head {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    margin-bottom: 2px !important;
  }
  .trend-theme-head .tt-name {
    color: #111 !important;
    font-size: 8pt !important;
    font-weight: 700 !important;
    flex: 1 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  .trend-theme-head .tt-chg {
    font-size: 7.5pt !important;
    font-weight: 700 !important;
  }
  .trend-theme-head .tt-extra {
    font-size: 6.5pt !important;
    color: #1565c0 !important;
    background: #e3f2fd !important;
    padding: 1px 4px !important;
    border-radius: 2px !important;
  }
  .trend-stocks-list {
    padding-left: 4px !important;
  }
  .trend-stock-row {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 1px 0 !important;
    font-size: 7pt !important;
    line-height: 1.3 !important;
  }
  .trend-stock-row .ts-name {
    color: #222 !important;
    flex: 1 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  .trend-stock-row .ts-chg {
    width: 42px !important;
    text-align: right !important;
    font-weight: 600 !important;
    font-size: 7pt !important;
  }
  .trend-stock-row .ts-vol {
    width: 50px !important;
    text-align: right !important;
    color: #666 !important;
    font-size: 6.5pt !important;
  }

  /* 테마 트렌드 / 투자자 매매동향 PDF */
  .trend-section-title {
    font-size: 10pt !important;
    font-weight: 800 !important;
    color: #1565c0 !important;
    margin: 8px 0 3px !important;
    padding: 2px 6px !important;
    background: #e3f2fd !important;
    border-left: 3px solid #1565c0 !important;
    page-break-after: avoid !important;
  }
  .trend-section-title:first-of-type { margin-top: 0 !important; }
  .trend-table, .investor-table, .investor-theme-table {
    width: 100% !important;
    border-collapse: collapse !important;
    background: #fff !important;
    table-layout: fixed !important;
    margin-bottom: 4px !important;
  }
  .trend-table th, .investor-table th, .investor-theme-table th {
    background: #f0f0f0 !important;
    color: #333 !important;
    border: 1px solid #ccc !important;
    padding: 3px 4px !important;
    font-size: 7pt !important;
    font-weight: 700 !important;
    text-align: left !important;
    white-space: nowrap !important;
  }
  .trend-table td, .investor-table td, .investor-theme-table td {
    background: #fff !important;
    color: #222 !important;
    border: 1px solid #eee !important;
    padding: 2px 4px !important;
    font-size: 7pt !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
  }
  .trend-table .cat-badge, .investor-theme-table .cat-badge {
    display: inline-block;
    background: #e3f2fd !important;
    color: #1565c0 !important;
    padding: 1px 4px !important;
    border-radius: 3px !important;
    font-size: 6.5pt !important;
    font-weight: 600 !important;
  }
  .investor-theme-table .theme-stocks-cell {
    white-space: normal !important;
    font-size: 7pt !important;
    line-height: 1.4 !important;
    color: #222 !important;
  }
  .investor-theme-table .theme-stock-item {
    display: inline-block !important;
    margin-right: 6px !important;
    white-space: nowrap !important;
  }

  /* 특징주 PDF 카드 (featured.html 스타일과 동일, 흰색 배경) */
  .featured-print-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }
  .featured-print-card {
    background: #fff !important;
    border: 1px solid #bbb !important;
    border-radius: 4px !important;
    padding: 6px 8px !important;
    page-break-inside: avoid !important;
  }
  .featured-print-card.grade-leader { border-color: #c62828 !important; border-width: 1.5px !important; }
  .featured-print-card.grade-strong { border-color: #e65100 !important; }
  .featured-print-card.grade-watch { border-color: #1565c0 !important; }
  .featured-print-head {
    display: flex !important;
    align-items: flex-start !important;
    gap: 6px !important;
    margin-bottom: 4px !important;
  }
  .featured-print-rank {
    background: #f0f0f0 !important;
    color: #555 !important;
    width: 16px !important; height: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    font-size: 7pt !important;
    font-weight: 700 !important;
    flex-shrink: 0 !important;
  }
  .featured-print-name-wrap { flex: 1 !important; }
  .featured-print-name {
    color: #111 !important;
    font-size: 9pt !important;
    font-weight: 700 !important;
  }
  .featured-print-code {
    color: #666 !important;
    font-size: 6.5pt !important;
    margin-top: 1px !important;
  }
  .featured-print-grade {
    font-size: 6.5pt !important;
    font-weight: 700 !important;
    padding: 1px 4px !important;
    border-radius: 3px !important;
    flex-shrink: 0 !important;
  }
  .featured-print-grade.grade-leader { background: #ffcdd2 !important; color: #c62828 !important; }
  .featured-print-grade.grade-strong { background: #fff3e0 !important; color: #e65100 !important; }
  .featured-print-grade.grade-watch { background: #e3f2fd !important; color: #1565c0 !important; }
  .featured-print-grade.grade-skip { background: #f5f5f5 !important; color: #666 !important; }
  .featured-print-price-row {
    display: flex !important;
    align-items: baseline !important;
    gap: 6px !important;
    padding: 3px 0 !important;
    border-bottom: 1px solid #eee !important;
    margin-bottom: 4px !important;
  }
  .featured-print-price { font-size: 10pt !important; font-weight: 700 !important; }
  .featured-print-change { font-size: 8pt !important; font-weight: 600 !important; }
  .featured-print-score {
    margin-left: auto !important;
    background: #f5f5f5 !important;
    color: #333 !important;
    padding: 1px 5px !important;
    border-radius: 3px !important;
    font-size: 6.5pt !important;
    font-weight: 600 !important;
  }
  .featured-print-stats {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 4px !important;
    margin-bottom: 4px !important;
  }
  .featured-print-stats > div { display: flex !important; flex-direction: column !important; }
  .featured-print-stats .lbl { color: #888 !important; font-size: 6pt !important; }
  .featured-print-stats .val { color: #222 !important; font-size: 7pt !important; font-weight: 600 !important; }
  .featured-print-stats .val.check { color: #2e7d32 !important; }
  .featured-print-news {
    border-top: 1px solid #eee !important;
    padding-top: 4px !important;
  }
  .featured-print-news-title {
    color: #666 !important;
    font-size: 6.5pt !important;
    margin-bottom: 2px !important;
    font-weight: 600 !important;
  }
  .featured-print-news-item {
    color: #1565c0 !important;
    font-size: 6.5pt !important;
    line-height: 1.3 !important;
    padding: 1px 0 !important;
    display: block !important;
    text-decoration: underline !important;
  }

  /* 섹터 요약 카드 - 3열 x 4행(12개), 인쇄용 흰색 */
  .sector-summary-grid,
  #sector-summary-cards {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
    background: #fff !important;
  }
  .sector-summary-card {
    background: #fff !important;
    border: 1px solid #bbb !important;
    border-radius: 4px !important;
    overflow: hidden !important;
    page-break-inside: avoid !important;
  }
  .sector-summary-header {
    background: #f0f0f0 !important;
    padding: 4px 6px !important;
    gap: 4px !important;
    border-bottom: 1px solid #ccc !important;
    flex-wrap: wrap !important;
  }
  .sector-summary-rank {
    background: #e3f2fd !important;
    color: #1565c0 !important;
    width: 18px !important; height: 18px !important;
    font-size: 7pt !important;
    flex-shrink: 0 !important;
  }
  .sector-summary-name {
    color: #111 !important; font-size: 7.5pt !important; font-weight: 700 !important;
    word-break: keep-all !important;
    overflow-wrap: break-word !important;
    line-height: 1.2 !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
  .sector-summary-change { font-size: 7.5pt !important; font-weight: 700 !important; white-space: nowrap !important; flex-shrink: 0 !important; }
  .sector-summary-meta {
    color: #666 !important; font-size: 6pt !important; white-space: nowrap !important;
    width: 100% !important;
  }
  /* 종목 테이블 - 고정 레이아웃 + 열 너비 강제 */
  .sector-stock-table {
    width: 100% !important; background: #fff !important;
    table-layout: fixed !important;
  }
  .sector-stock-table col.col-rank { width: 9% !important; }
  .sector-stock-table col.col-name { width: 51% !important; }
  .sector-stock-table col.col-chg { width: 18% !important; }
  .sector-stock-table col.col-vol { width: 22% !important; }
  .sector-stock-table th {
    color: #555 !important; font-size: 6.5pt !important; background: #fafafa !important;
    padding: 3px 4px !important; border-bottom: 1px solid #ccc !important;
    white-space: nowrap !important;
    text-align: left !important;
  }
  .sector-stock-table td {
    color: #222 !important; font-size: 7pt !important; background: #fff !important;
    padding: 2px 4px !important; border-bottom: 1px solid #eee !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    line-height: 1.3 !important;
  }
  .sector-stock-table td:nth-child(2) {
    white-space: normal !important;
    word-break: keep-all !important;
    overflow-wrap: break-word !important;
  }
  .sector-stock-table td:nth-child(3),
  .sector-stock-table td:nth-child(4) { text-align: right !important; }
  .sector-stock-table tr:hover { background: #fff !important; }

  /* 선제매수 포착 보고서 */
  .early-report-themes {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }
  .early-report-theme-card {
    background: #fff !important;
    border: 1px solid #bbb !important;
    border-radius: 4px !important;
    padding: 6px 8px !important;
    page-break-inside: avoid !important;
  }
  .early-report-theme-header {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding-bottom: 4px !important;
    margin-bottom: 4px !important;
    border-bottom: 1px solid #ddd !important;
  }
  .early-report-theme-name {
    color: #111 !important;
    font-size: 8.5pt !important;
    font-weight: 700 !important;
    flex: 1 !important;
  }
  .early-report-theme-meta {
    display: flex !important;
    gap: 6px !important;
    font-size: 6.5pt !important;
    color: #666 !important;
    margin-bottom: 4px !important;
    flex-wrap: wrap !important;
  }
  .early-report-theme-meta span {
    background: #f5f5f5 !important;
    padding: 1px 4px !important;
    border-radius: 2px !important;
  }
  .early-report-filter-note {
    font-size: 6.5pt !important;
    color: #666 !important;
    margin-top: 6px !important;
    padding: 3px 6px !important;
    background: #f5f5f5 !important;
    border-radius: 2px !important;
  }

  /* 저작권 footer 인쇄 숨김 (상단 print-header에 이미 있음) */
  .copyright-footer { display: none !important; }

  /* 뉴스 뒤에 새 페이지 강제되지 않도록 */
  .print-page2 { page-break-after: avoid !important; }

  /* 대시보드 마지막 카드가 빈 페이지 생성 방지 */
  .main > .card:last-of-type { page-break-after: auto !important; }
  .sidebar-ad, .sidebar-auth, .point-toast, .pw-modal-overlay { display: none !important; }
}

/* ===== Sidebar Ad & Points ===== */
.sidebar-ad {
  padding: 10px 12px;
  border-top: 1px solid #21262d;
}
.sidebar-points-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  background: linear-gradient(135deg, #1a1f2e, #1e2636);
  border: 1px solid #30363d;
  border-radius: 8px;
  margin-bottom: 8px;
}
.sidebar-points-label { font-size: 11px; color: #8b949e; }
.sidebar-points-value { font-size: 16px; font-weight: 700; color: #ffd700; }
.sidebar-ad-notice { font-size: 10px; color: #8b949e; text-align: center; margin: 6px 0; }
.sidebar-ad-notice strong { color: #ffd700; }
.sidebar-ad-wrap { text-align: center; border-radius: 6px; overflow: hidden; background: #0d1117; }
.sidebar-ad-remaining { font-size: 10px; color: #c9d1d9; text-align: center; margin-top: 4px; }

/* Sidebar Auth Buttons */
.sidebar-auth { padding: 8px 12px 0; border-top: 1px solid #21262d; }
.sidebar-auth-btn {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 7px 10px; border: 1px solid #30363d; border-radius: 8px;
  background: transparent; color: #8b949e; font-size: 11px;
  cursor: pointer; transition: all 0.2s; margin-bottom: 5px;
  font-family: inherit;
}
.sidebar-auth-btn:hover { background: rgba(255,255,255,0.05); color: #d0d4dc; border-color: #484f58; }
.sidebar-auth-btn.authenticated { border-color: #238636; color: #3fb950; }
.nav-cost { font-size: 10px; color: #ffd700; margin-left: auto; opacity: 0.8; }

/* Point Toast */
.point-toast {
  position: fixed; top: 20px; left: 50%; z-index: 10000;
  transform: translateX(-50%) translateY(-100px);
  background: #1a1f2e; border: 1px solid #ffd700; color: #ffd700;
  padding: 10px 24px; border-radius: 8px; font-size: 14px; font-weight: 600;
  transition: transform 0.3s ease; pointer-events: none;
}
.point-toast.show { transform: translateX(-50%) translateY(0); }
.point-toast.deduct { border-color: #f85149; color: #f85149; }

/* Password Modal */
.pw-modal-overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7); z-index: 9999;
  align-items: center; justify-content: center;
}
.pw-modal-overlay.show { display: flex; }
.pw-modal {
  background: #161b22; border: 1px solid #30363d; border-radius: 12px;
  padding: 24px; width: 320px; max-width: 90vw;
}
.pw-modal h3 { color: #f0f6fc; font-size: 16px; margin: 0 0 16px; }
.pw-modal input {
  width: 100%; padding: 10px 12px; border: 1px solid #30363d; border-radius: 6px;
  background: #0d1117; color: #f0f6fc; font-size: 16px; text-align: center;
  letter-spacing: 8px; margin-bottom: 12px; box-sizing: border-box; font-family: inherit;
}
.pw-modal input:focus { outline: none; border-color: #f45b69; }
.pw-modal-buttons { display: flex; gap: 8px; }
.pw-modal-buttons button {
  flex: 1; padding: 8px; border: none; border-radius: 6px;
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.pw-modal-btn-primary { background: #f45b69; color: #fff; }
.pw-modal-btn-primary:hover { background: #e04e5c; }
.pw-modal-btn-cancel { background: #21262d; color: #8b949e; }
.pw-modal-btn-cancel:hover { background: #30363d; }
.pw-list { margin: 12px 0; max-height: 150px; overflow-y: auto; }
.pw-list-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px; background: #0d1117; border-radius: 4px;
  margin-bottom: 4px; color: #f0f6fc; font-size: 14px; letter-spacing: 4px;
}
.pw-list-item button {
  background: none; border: none; color: #f85149; cursor: pointer;
  font-size: 18px; padding: 0 4px;
}
