/* ───────────── 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 ───────────── */

/* ───────────── 유료 전환 안내 팝업 ───────────── */
.plan-popup {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.plan-popup.show {
  display: flex;
}
.plan-popup-card {
  position: relative;
  width: min(440px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 24px 20px;
  border-radius: 16px;
  background:
    radial-gradient(700px 360px at 85% 0%, rgba(43, 94, 138, 0.4), transparent 60%),
    linear-gradient(160deg, #0d1622 0%, #0a0f17 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  color: #e7ecf3;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    system-ui, Roboto, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}
.plan-popup-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #9fb0c3;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.plan-popup-close:hover { color: #fff; }

.plan-popup-logo {
  display: block;
  width: 120px;
  height: auto;
  margin: 0 auto 16px;
}

.plan-popup-title {
  margin: 0 24px 12px 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.3;
}
.plan-popup-title .hl { color: #ff5b5b; }

.plan-popup-desc {
  margin: 0 0 20px;
  font-size: 13.5px;
  line-height: 1.7;
  color: #c6d1dd;
}

.plan-popup-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ppcard {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
}
.ppcard__head {
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  padding: 9px;
  color: #fff;
}
.ppcard--month .ppcard__head { background: #1d2c44; }
.ppcard--year .ppcard__head { background: #a32530; }
.ppcard__body {
  background: #f4f7fb;
  color: #1b2330;
  flex: 1;
  padding: 16px 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.ppcard__price {
  font-size: 15px;
  font-weight: 600;
  color: #233044;
}
.ppcard--year .ppcard__price { color: #a32530; }
.ppcard__price strong {
  font-size: 24px;
  font-weight: 800;
  margin-left: 3px;
}
.ppcard__vat {
  font-size: 11px;
  color: #7a8694;
  margin-top: 3px;
}
.ppcard__cta {
  margin-top: 14px;
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  background: #1d2c44;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: filter 0.15s;
}
.ppcard__cta--year { background: #a32530; }
.ppcard__cta:hover { filter: brightness(1.12); }

.plan-popup-dismiss {
  display: block;
  margin: 18px auto 4px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: transparent;
  color: #9fb0c3;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.plan-popup-dismiss:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

@media (max-width: 380px) {
  .plan-popup-cards { grid-template-columns: 1fr; }
}

/* ───────────── 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;
  }
  .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: 10px;
    font-size: 0.7rem !important;
  }
  #bar-container .chart-value {
    left: 10px;
  }
  #stock-bar-container .chart-value {
    left: 10px;
  }
  .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: 10px;
    font-size: 0.55rem !important;
  }
  #bar-container .chart-value {
    left: 10px;
  }
  #stock-bar-container .chart-value {
    left: 10px;
  }
  .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;
}