/* ───────────── Global Reset & Base ───────────── */
*, *::before, *::after {
  box-sizing: border-box;
}
body {
  background: white;
  color: #333D4B;
  font-family: Pretendard Variable,Pretendard,-apple-system,BlinkMacSystemFont,system-ui,Roboto,Helvetica Neue,Segoe UI,Apple SD Gothic Neo,Noto Sans KR,Malgun Gothic,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,sans-serif;
  padding: 20px 20px 20px 100px; /* left 100px = sideMenu 80px + 여백 20px */
  display: flex;
  justify-content: center;
  font-size: 14px;
}
.container {
  width: 60%;
  max-width: 1400px;
  margin-bottom: 30px;
}

/* ───────────── Layout ───────────── */

/* 우측 광고 배너 (PC only) */
.right-banner {
  position: fixed;
  left: calc(50% + 32%);
  top: 50%;
  transform: translateY(-50%);
  width: 250px;
  height: 600px;
  z-index: 100;
}
.right-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}
@media (max-width: 1400px) {
  .right-banner {
    display: none;
  }
}

/* ───────────── Mobile Popup ───────────── */
.mobile-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}
.mobile-popup.show {
  display: flex;
}
.mobile-popup-content {
  position: relative;
  width: 259px;
  height: 318px;
}
.popup-bg {
  width: 100%;
  height: 100%;
  border-radius: 12px;
}
.popup-exit1 {
  position: absolute;
  left: 229px;
  top: 21px;
  cursor: pointer;
}
.popup-text {
  position: absolute;
  left: 35px;
  top: 106px;
}
.popup-start {
  position: absolute;
  left: 19px;
  top: 246px;
  cursor: pointer;
}
.popup-exit2 {
  position: absolute;
  left: 94px;
  top: 290px;
  cursor: pointer;
}
@media (min-width: 1024px) {
  .mobile-popup {
    display: none !important;
  }
}

/* ───────────── Responsive ───────────── */
@media (min-width: 1024px) {
  .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;

  }
}
@media (max-width: 1023px) {
  .container {
    display: block;
    padding-bottom: 60px; /* 내비 높이가 50px이라면 50px, 60px으로 약간 여유를 줘도 좋습니다 */
  }
  .right-panel {
    display: none;
  }
  .right-banner {
    display: none; /* 태블릿/모바일에서 배너 숨김 */
  }
  .combo-title {
    display: none;
  }
  .combo-bar {
    justify-content: space-between;
    flex-wrap: nowrap;
  }
  .view-toggle {
    display: flex;
  }
  .combo-group {
    flex: 1;
    justify-content: flex-end;
  }
}
@media (max-width: 480px) {
  body {
    padding-left: 20px; /* 모바일: sideMenu 숨김이므로 원래 패딩으로 복구 */
  }
}
@media (max-width: 390px) {
  body {
    font-size: 13px;
  }
  .combo-title {
    font-size: 0.95rem;
  }
  .view-toggle button {
    font-size: 0.7rem;
    height: 34px;
    padding: 0 12px;
  }
  .combo-group select {
    font-size: 0.7rem;
    height: 34px;
    padding: 4px 25px;
  }
  .filter-bar {
    font-size: 12px;
  }
  .filter-bar input.filter-input {
    width: 80px;
    font-size: 0.8rem;
  }
  .filter-bar button.filter-save-btn {
    font-size: 0.8rem;
    padding: 6px 12px;
  }
  .chart-label {
  width: 120px;
    font-size: 0.8rem !important;
  }
  #bar-container .chart-label {
    width: 100px;
  }
  #stock-bar-container .chart-label {
    width: 110px;
  }
  .chart-value {
    left: 160px;
    font-size: 0.7rem !important;
  }
  #bar-container .chart-value {
    left: 190px;
  }
  #stock-bar-container .chart-value {
    left: 200px;
  }
  .stock-theme, .stock-code {
    font-size: 0.8rem !important;
  }
  .hot-theme-card .ht-theme {
    font-size: 0.8rem !important;
  }
}

@media (max-width: 350px) {
  body {
    font-size: 13px;
  }
  .combo-title {
    font-size: 0.95rem;
  }
  .view-toggle button {
    font-size: 0.6rem;
    height: 34px;
    padding: 0 12px;
  }
  .combo-group select {
    font-size: 0.6rem;
    height: 34px;
    padding: 4px 25px;
  }
  .chart-value,
  .chart-label {
    font-size: 0.65rem;
  }
  .filter-bar {
    font-size: 12px;
  }
  .filter-bar input.filter-input {
    width: 80px;
    font-size: 0.8rem;
  }
  .filter-bar button.filter-save-btn {
    font-size: 0.8rem;
    padding: 6px 12px;
  }
  .chart-label {
  width: 120px;
    font-size: 0.8rem !important;
  }
  #bar-container .chart-label {
    width: 100px;
  }
  #stock-bar-container .chart-label {
    width: 110px;
  }
  .chart-value {
    left: 150px;
    font-size: 0.55rem !important;
  }
  #bar-container .chart-value {
    left: 180px;
  }
  #stock-bar-container .chart-value {
    left: 190px;
  }
  .stock-theme, .stock-code {
    font-size: 0.8rem !important;
  }
  .hot-theme-card .ht-theme {
    font-size: 0.8rem !important;
  }
}

.chart-label:hover, .stock-name:hover {
  pointer-events: auto;   /* 마우스 올렸을 때만 선택 가능 */
  cursor: pointer;        /* 마우스 올리면 손가락 모양 */
  background-color: #f0f0f0; /* 시각적 효과 */
}

.change.up {
  color: #f33;
}
.change.down {
  color:  #4fabff;
}