/* CryptoPingAi 통합 차트 컴포넌트 (cp-chart.js) — 우리 디자인 */
.cp-chart-wrap {
  position: relative;
  background: #0c0c0c;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  overflow: hidden;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* 상단 툴바 */
.cp-chart-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #161616;
  border-bottom: 1px solid #2a2a2a;
  flex-wrap: wrap;
  min-height: 40px;
}
.cp-chart-symbol {
  font-size: 13px;
  font-weight: 700;
  color: #f0f0f0;
  letter-spacing: -0.2px;
  margin-right: 4px;
}
.cp-chart-symbol .cp-chart-ex {
  font-size: 10.5px;
  color: #999;
  font-weight: 500;
  margin-left: 4px;
  background: #222;
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}
.cp-chart-price {
  font-size: 13px;
  font-weight: 700;
  color: #22c55e;
}
.cp-chart-price.down { color: #f43f5e; }
.cp-chart-change {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(34,197,94,.15);
  color: #22c55e;
}
.cp-chart-change.down {
  background: rgba(244,63,94,.15);
  color: #f43f5e;
}

.cp-chart-tf-group, .cp-chart-ind-group {
  display: flex;
  gap: 2px;
  margin-left: auto;
  background: #0c0c0c;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 2px;
}
/* 지표바: 좁아지면 자연스럽게 2줄로 wrap */
.cp-chart-ind-group {
  flex-wrap: wrap;
  row-gap: 4px;
}
/* timeframe 그룹: 항상 1줄, 좁으면 가로 스크롤 (스크롤바 숨김) */
.cp-chart-tf-group {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.cp-chart-tf-group::-webkit-scrollbar { display: none; }
.cp-chart-tf-group { margin-left: auto; }
.cp-chart-ind-group { margin-left: 6px; }
.cp-chart-tf, .cp-chart-ind {
  padding: 4px 9px;
  background: transparent;
  border: none;
  color: #999;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  font-family: inherit;
  transition: all 0.15s;
;white-space:nowrap;flex-shrink:0}
.cp-chart-tf:hover, .cp-chart-ind:hover { color: #f0f0f0; background: #1a1a1a; }
.cp-chart-tf.active, .cp-chart-ind.active {
  background: #f59e0b;
  color: #000;
}

/* 차트 본체 */
.cp-chart-body {
  position: relative;
  width: 100%;
  height: 480px;
  background: #0c0c0c;
}
.cp-chart-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12,12,12,.85);
  color: #999;
  font-size: 13px;
  z-index: 10;
}
.cp-chart-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #0c0c0c;
  color: #f43f5e;
  font-size: 13px;
  z-index: 10;
  padding: 20px;
  text-align: center;
}
.cp-chart-error-detail {
  font-size: 11px;
  color: #666;
}

@media (max-width: 640px) {
  .cp-chart-body { height: 360px; }
  .cp-chart-toolbar { padding: 6px 8px; gap: 4px; }
  .cp-chart-symbol { font-size: 12px; }
  .cp-chart-tf, .cp-chart-ind { padding: 3px 7px; font-size: 10.5px; }
  /* 모바일은 일부 timeframe 숨김 */
  .cp-chart-tf[data-tf="2h"],
  .cp-chart-tf[data-tf="6h"],
  .cp-chart-tf[data-tf="12h"] { display: none; }
}

.cp-chart-live { font-size: 11px; line-height: 1; padding: 2px 4px; cursor: help; user-select: none; }
.cp-chart-loading { display: flex; }

.cp-chart-ctype{padding:4px 8px;background:#0c0c0c;border:1px solid #2a2a2a;border-radius:6px;color:#f0f0f0;font-size:11.5px;font-family:inherit;font-weight:600;cursor:pointer;margin-left:6px;}
.cp-chart-ctype:hover{border-color:#f59e0b;}
.cp-chart-ctype:focus{outline:none;border-color:#f59e0b;}
