/* ══════════════════════════════
   종목 검색 드로어
══════════════════════════════ */

/* 사이드바 검색창 — 기존 sidebar-tab 디자인 언어 통일 */
.sidebar-search { padding: 0 10px 8px; }
.sidebar-search-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--text4);
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 10px 0 5px;
}
.sidebar-search-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color var(--duration) var(--ease-out), background var(--duration) var(--ease-out);
  cursor: text;
}
.sidebar-search-wrap:focus-within {
  border-color: var(--accent);
  background: var(--surface2);
}
.sidebar-search-icon { color: var(--text3); flex-shrink: 0; pointer-events: none; }
.sidebar-search-input {
  flex: 1; border: none; background: transparent;
  color: var(--text); font-family: var(--font-mono); font-size: 11.5px;
  outline: none; min-width: 0;
}
.sidebar-search-input::placeholder { color: var(--text4); }

/* 자동완성 드롭다운 */
.search-suggestions {
  position: absolute; left: -10px; right: -10px; top: calc(100% + 6px);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  z-index: calc(var(--z-modal) + 10);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.search-suggestions:empty { display: none; }
.search-suggestion-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; cursor: pointer;
  font-family: var(--font-mono); font-size: 11px;
  transition: background .1s;
}
.search-suggestion-item:hover,
.search-suggestion-item.active { background: var(--bg2); }
.sg-hl { background: rgba(52,211,153,.2); color: var(--accent); border-radius: 2px; }
.suggestion-ticker { font-weight: 700; color: var(--text); flex-shrink: 0; min-width: 44px; }
.suggestion-name { color: var(--text3); font-size: 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; flex: 1; display: flex; align-items: center; gap: 4px; }
.suggestion-exch { color: var(--text4); font-size: 8px; padding: 1px 4px; background: var(--bg); border-radius: 2px; flex-shrink: 0; }

/* 드로어 배경 */
.stock-drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  z-index: calc(var(--z-modal) - 2);
  opacity: 0; visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
.stock-drawer-backdrop.open { opacity: 1; visibility: visible; }

/* 드로어 패널 */
.stock-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 580px; max-width: 100vw;
  background: var(--surface); border-left: 1px solid var(--border2);
  z-index: calc(var(--z-modal) - 1);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--shadow-lg);
}
.stock-drawer.open { transform: translateX(0); }

/* 드로어 헤더 */
.stock-drawer-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 14px 16px 12px; border-bottom: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0;
}
.stock-drawer-close {
  background: none; border: none; color: var(--text2);
  font-size: 18px; cursor: pointer; padding: 2px 6px;
  border-radius: 4px; line-height: 1; margin-top: -2px; margin-left: 8px;
}
.stock-drawer-close:hover { color: var(--text1); background: var(--bg2); }

/* 탭 바 */
.stock-drawer-tabs {
  display: flex; border-bottom: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0;
}
.stock-drawer-tab {
  flex: 1; padding: 9px 4px; border: none;
  background: none; color: var(--text2);
  font-family: var(--font-mono); font-size: 11px; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.stock-drawer-tab:hover { color: var(--text1); }
.stock-drawer-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* 드로어 바디 */
.stock-drawer-body {
  flex: 1; overflow-y: auto; padding: 14px 16px;
  scrollbar-width: thin; scrollbar-color: var(--border2) transparent;
}
.stock-drawer-body::-webkit-scrollbar { width: 5px; }
.stock-drawer-body::-webkit-scrollbar-track { background: transparent; }
.stock-drawer-body::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* 탭 패널 */
.stock-tab-pane { display: none; }
.stock-tab-pane.active { display: block; }

/* 섹션 타이틀 */
.stock-section-title {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px;
  margin: 14px 0 6px;
}

/* 점수 바 */
.stock-score-bar { height: 3px; border-radius: 2px; background: var(--border); overflow: hidden; }
.stock-score-fill { height: 100%; border-radius: 2px; transition: width .4s; }

/* 지지/저항선 */
.sa-sr-levels {
  display: flex; flex-direction: column; gap: 4px;
  font-family: var(--font-mono); font-size: 11px;
}
.sa-sr-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px; border-radius: var(--r-sm);
  background: var(--bg);
}
.sa-sr-item.resistance { border-left: 3px solid #f87171; }
.sa-sr-item.support    { border-left: 3px solid #34d399; }
.sa-sr-item.current    { border-left: 3px solid var(--accent); background: var(--surface2); }
.sa-sr-label { color: var(--text3); font-size: 9px; min-width: 28px; }
.sa-sr-price { color: var(--text); font-weight: 600; }
.sa-sr-basis { color: var(--text4); font-size: 9px; padding: 1px 5px; background: var(--surface2); border-radius: 3px; }
.sa-sr-dist  { color: var(--text4); font-size: 9px; margin-left: auto; }

/* 캔들 패턴 neutral 배지 */
.stock-signal-badge.neutral {
  background: rgba(148,163,184,0.12);
  border-color: rgba(148,163,184,0.3);
  color: #94a3b8;
}

/* 종합 점수판 */
.sa-summary-board {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; margin-bottom: 12px;
  background: var(--bg); border-radius: var(--r-md);
  border: 1px solid var(--border);
}
.sa-summary-sentiment {
  font-family: var(--font-mono); font-size: 20px; font-weight: 700;
  flex-shrink: 0;
}
.sa-summary-details {
  display: flex; flex-wrap: wrap; gap: 8px;
  font-family: var(--font-mono); font-size: 11px;
}

/* 지표 그리드 */
.stock-indicator-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 4px;
}
.stock-indicator-cell {
  background: var(--bg); border-radius: var(--r-md); padding: 9px 8px; text-align: center;
  position: relative; overflow: hidden;
}
.stock-indicator-label {
  font-family: var(--font-mono); font-size: 9px; color: var(--text3);
  margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.3px;
}
.stock-indicator-value { font-family: var(--font-mono); font-size: 14px; font-weight: 700; }

/* RSI 게이지 */
.rsi-gauge { position: relative; width: 72px; height: 40px; margin: 2px auto 0; overflow: hidden; }
.rsi-gauge-bg { position: absolute; top: 0; left: 0; width: 72px; height: 72px;
  border-radius: 50%; border: 6px solid rgba(255,255,255,0.06); border-bottom-color: transparent;
  border-left-color: transparent; transform: rotate(-90deg); clip-path: inset(0 0 50% 0); }
.rsi-gauge-fill { position: absolute; top: 0; left: 0; width: 72px; height: 72px;
  border-radius: 50%; border: 6px solid transparent; border-bottom-color: transparent;
  border-left-color: transparent; transform: rotate(-90deg); clip-path: inset(0 0 50% 0);
  transition: border-color 0.3s; }
.rsi-gauge-label { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 13px; font-weight: 700; line-height: 1; }
.rsi-gauge-zone { display: flex; justify-content: space-between; width: 72px; margin: 1px auto 0;
  font-family: var(--font-mono); font-size: 7px; color: var(--text3); opacity: 0.6; }
.rsi-zone-current { font-weight: 700; opacity: 1; font-size: 8px; }
.rsi-zone-active { opacity: 1; font-weight: 600; }

/* MACD 미니 히스토그램 */
.macd-mini-hist { display: flex; align-items: flex-end; justify-content: center;
  gap: 1px; height: 24px; margin: 4px auto 0; width: 56px; }
.macd-mini-hist .bar { width: 4px; border-radius: 1px; min-height: 1px;
  transition: height 0.3s; }

/* BB %B / 거래량 / MA 수평 게이지 */
.horiz-gauge { position: relative; height: 5px; border-radius: 3px;
  background: rgba(255,255,255,0.06); margin: 6px 4px 0; overflow: visible; }
.horiz-gauge-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }
.horiz-gauge-dot { position: absolute; top: 50%; width: 9px; height: 9px;
  border-radius: 50%; transform: translate(-50%, -50%);
  border: 1.5px solid rgba(0,0,0,0.5); box-shadow: 0 0 3px rgba(0,0,0,0.4); }
.horiz-gauge-labels { display: flex; justify-content: space-between; margin: 1px 4px 0;
  font-family: var(--font-mono); font-size: 7px; color: var(--text3); opacity: 0.6; }

/* 신호 배지 */
.stock-signals-wrap { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.stock-signal-badge {
  font-family: var(--font-mono); font-size: 11px; padding: 3px 10px; border-radius: 12px;
}
.stock-signal-badge.buy  { background: rgba(52,211,153,.12); color: #34d399; border: 1px solid rgba(52,211,153,.25); }
.stock-signal-badge.sell { background: rgba(248,113,113,.12); color: #f87171; border: 1px solid rgba(248,113,113,.25); }

/* 시스템 추적 카드 */
.stock-bot-card {
  padding: 12px 14px; background: var(--bg); border-radius: var(--r-md); border: 1px solid var(--border);
}

/* 로딩 */
.stock-loading {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; padding: 60px 20px;
  font-family: var(--font-mono); font-size: 12px; color: var(--text2);
}
.stock-loading-spinner {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--border2); border-top-color: var(--accent);
  animation: stock-spin .8s linear infinite;
}
@keyframes stock-spin { to { transform: rotate(360deg); } }

/* AI 분석 */
.stock-ai-verdict {
  border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 10px; border: 1px solid;
}
.stock-ai-verdict.bullish { background: rgba(52,211,153,.06); border-color: rgba(52,211,153,.2); }
.stock-ai-verdict.neutral { background: rgba(251,191,36,.06);  border-color: rgba(251,191,36,.2); }
.stock-ai-verdict.bearish { background: rgba(248,113,113,.06); border-color: rgba(248,113,113,.2); }
.stock-ai-block {
  background: var(--bg); border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 8px;
}
.stock-ai-block-title {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 7px;
}
.stock-ai-text { font-family: var(--font-mono); font-size: 11px; color: var(--text2); line-height: 1.7; }
.stock-ai-points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.stock-ai-points li { font-family: var(--font-mono); font-size: 11px; color: var(--text2); }
.stock-ai-disclaimer {
  font-family: var(--font-mono); font-size: 10px; color: var(--text3);
  text-align: center; margin-top: 14px; padding: 10px;
  border-top: 1px solid var(--border); line-height: 1.6;
}

/* 뉴스 */
.stock-news-item { padding: 11px 0; border-bottom: 1px solid var(--border); }
.stock-news-item:last-child { border-bottom: none; }
.stock-news-title {
  font-size: 12px; font-weight: 500; color: var(--text1);
  line-height: 1.45; text-decoration: none; display: block; transition: color .15s;
}
.stock-news-title:hover { color: var(--accent); }
.stock-news-desc {
  font-family: var(--font-mono); font-size: 10px; color: var(--text2);
  margin-top: 4px; line-height: 1.5;
}
.stock-news-meta { font-family: var(--font-mono); font-size: 10px; color: var(--text3); margin-top: 4px; }

/* 차트 탭 — 가격 요약 */
.stock-chart-summary {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 10px; padding: 0 2px;
}
.stock-chart-price-row {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.stock-chart-price {
  font-family: var(--font-mono); font-size: 22px; font-weight: 700; color: var(--text);
}
.stock-chart-chg {
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
}
.stock-chart-range-chg {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  padding: 1px 6px; border-radius: 3px; background: rgba(255,255,255,.04);
}
.stock-chart-hilo {
  display: flex; gap: 10px;
  font-family: var(--font-mono); font-size: 10px; color: var(--text3);
}

/* 차트 컨트롤 바 */
.stock-chart-controls {
  display: flex; align-items: center; gap: 4px; margin-bottom: 8px; flex-wrap: wrap;
}
.stock-chart-controls .ctrl-group {
  display: flex; gap: 2px; margin-right: 8px;
}
.stock-chart-btn {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  padding: 3px 8px; border-radius: 4px; cursor: pointer;
  background: transparent; color: var(--text3);
  border: 1px solid var(--border); transition: all .15s;
}
.stock-chart-btn:hover { color: var(--text2); border-color: var(--border2); }
.stock-chart-btn.active { background: rgba(62,207,142,.15); color: var(--accent); border-color: rgba(62,207,142,.4); }

/* 메인 차트 영역 */
.stock-chart-main-wrap {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 8px 10px 4px; margin-bottom: 4px;
  height: 260px; max-height: 260px; position: relative; overflow: hidden;
}
@media (max-width: 600px) {
  .stock-chart-main-wrap { height: 200px; max-height: 200px; }
}

/* 줌 힌트 */
.stock-chart-zoom-hint {
  position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 9px; color: var(--text3);
  background: rgba(15,15,15,.8); padding: 3px 10px; border-radius: 4px;
  pointer-events: none; opacity: 0; transition: opacity .4s;
  white-space: nowrap;
}

/* 거래량 라벨 */
.stock-chart-vol-label {
  font-family: var(--font-mono); font-size: 9px; font-weight: 600;
  color: var(--text4); text-transform: uppercase; letter-spacing: 0.5px;
  margin: 6px 0 2px 2px;
}

/* 거래량 차트 컨테이너 */
.stock-vol-wrap {
  height: 50px; max-height: 50px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 2px 10px; overflow: hidden;
}

/* RS 배지 */
.rs-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 6px;
}
.rs-badge.strong  { background: rgba(52,211,153,.12); color: #34d399; border: 1px solid rgba(52,211,153,.25); }
.rs-badge.weak    { background: rgba(248,113,113,.12); color: #f87171; border: 1px solid rgba(248,113,113,.25); }
.rs-badge.neutral { background: rgba(160,160,160,.08); color: var(--text3); border: 1px solid var(--border); }

/* 빠른 비교 오버레이 */
.qc-overlay-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7); backdrop-filter: blur(3px);
  z-index: var(--z-modal); opacity: 0; visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
.qc-overlay-backdrop.open { opacity: 1; visibility: visible; }
.qc-overlay {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%) scale(.95);
  width: 680px; max-width: 92vw; max-height: 85vh;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--r-lg); z-index: calc(var(--z-modal) + 1);
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden;
  transition: opacity .25s, visibility .25s, transform .25s var(--ease-out);
  box-shadow: var(--shadow-lg);
}
.qc-overlay.open { opacity: 1; visibility: visible; transform: translate(-50%,-50%) scale(1); }
.qc-overlay-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.qc-overlay-body { flex: 1; overflow-y: auto; padding: 16px; }
.qc-search-row {
  display: flex; gap: 8px; margin-bottom: 14px;
}
.qc-search-input {
  flex: 1; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 7px 10px;
  font-family: var(--font-mono); font-size: 12px; color: var(--text);
  outline: none;
}
.qc-search-input:focus { border-color: var(--accent); }
.qc-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.qc-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 14px; position: relative;
}
.qc-card-remove {
  position: absolute; top: 6px; right: 6px; background: none; border: none;
  color: var(--text3); cursor: pointer; font-size: 14px; padding: 2px 4px;
}
.qc-card-remove:hover { color: var(--red); }
.qc-sparkline { height: 40px; margin-top: 8px; }
@media (max-width: 600px) {
  .qc-grid { grid-template-columns: 1fr; }
  .qc-overlay { max-width: 96vw; }
}

/* Gemini AI 배지 */
.ai-source-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: 9px; font-weight: 600;
  padding: 2px 8px; border-radius: 4px; letter-spacing: 0.3px;
}
.ai-source-badge.gemini { background: rgba(99,179,237,.12); color: #63b3ed; border: 1px solid rgba(99,179,237,.3); }
.ai-source-badge.rule   { background: rgba(160,160,160,.08); color: var(--text3); border: 1px solid var(--border); }

/* 드로어 모바일 */
@media (max-width: 600px) {
  .stock-drawer { width: 100vw; }
  .history-drawer { width: 100vw; }
}

/* ══════════════════════════════
   청산 이력 드로어
══════════════════════════════ */
.history-drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  z-index: calc(var(--z-modal) - 2);
  opacity: 0; visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
.history-drawer-backdrop.open { opacity: 1; visibility: visible; }
.history-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 380px; max-width: 100vw;
  background: var(--surface); border-left: 1px solid var(--border2);
  z-index: calc(var(--z-modal) - 1);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--shadow-lg);
}
.history-drawer.open { transform: translateX(0); }
.history-drawer-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 14px 16px 12px; border-bottom: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0;
}
.history-drawer-body {
  flex: 1; overflow-y: auto; padding: 14px 16px;
  scrollbar-width: thin; scrollbar-color: var(--border2) transparent;
  display: flex; flex-direction: column; gap: 12px;
}
.history-drawer-body::-webkit-scrollbar { width: 5px; }
.history-drawer-body::-webkit-scrollbar-track { background: transparent; }
.history-drawer-body::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* 히어로 P&L */
.hd-hero {
  text-align: center; padding: 8px 0 4px;
}
.hd-hero-pnl {
  font-family: var(--font-mono); font-weight: 800; font-size: 36px; line-height: 1;
  letter-spacing: -1px;
}
.hd-hero-pnl.positive { color: var(--green); text-shadow: 0 0 24px rgba(52,211,153,.25); }
.hd-hero-pnl.negative { color: var(--red);   text-shadow: 0 0 24px rgba(248,113,113,.25); }
.hd-hero-pnl.neutral  { color: var(--text2); }
.hd-hero-sub {
  font-family: var(--font-mono); font-size: 11px; color: var(--text3); margin-top: 6px;
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
}
.hd-reason-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 600;
}
.hd-reason-badge.tp  { background: rgba(52,211,153,.12); color: var(--green); }
.hd-reason-badge.sl  { background: rgba(248,113,113,.12); color: var(--red); }
.hd-reason-badge.exp { background: rgba(148,163,184,.10); color: var(--text3); }
.hd-reason-badge.sig { background: rgba(251,146,60,.12);  color: #fb923c; }
.hd-reason-badge.tr  { background: rgba(56,189,248,.12);  color: #38bdf8; }

/* 차트 래퍼 */
.history-chart-wrap {
  position: relative;
  width: 100%; height: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 10px 8px 6px;
  box-sizing: border-box;
  flex-shrink: 0;
}
.history-chart-wrap canvas { width: 100% !important; height: 100% !important; }

/* 가격 플로우 바 */
.hd-price-flow {
  display: flex; align-items: stretch; gap: 0;
  border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; background: var(--bg);
}
.hd-pf-cell {
  flex: 1; padding: 10px 8px; text-align: center;
  border-right: 1px solid var(--border);
}
.hd-pf-cell:last-child { border-right: none; }
.hd-pf-label {
  font-family: var(--font-mono); font-size: 9px; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--text3); margin-bottom: 4px;
}
.hd-pf-val {
  font-family: var(--font-mono); font-size: 14px; font-weight: 700; color: var(--text1);
}
.hd-pf-val.dim { font-size: 12px; font-weight: 500; color: var(--text3); }
.hd-pf-val.red { color: var(--red); }
.hd-pf-val.green { color: var(--green); }

/* 섹션 구분선 */
.hd-section {
  padding-top: 10px;
}
.hd-section-title {
  font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--text3); margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.hd-section-title::before {
  content: ''; width: 2px; height: 10px; border-radius: 1px;
  background: var(--accent); flex-shrink: 0;
}

/* 점수 바 */
.hd-score-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.hd-score-label {
  font-family: var(--font-mono); font-size: 11px; color: var(--text2);
  width: 56px; flex-shrink: 0; text-align: right;
}
.hd-score-bar {
  flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden;
}
.hd-score-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), #38bdf8);
  transition: width .4s ease;
}
.hd-score-val {
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  color: var(--text1); width: 32px; text-align: left;
}

/* 신호 태그 */
.hd-tag {
  display: inline-block; padding: 2px 8px; border-radius: 5px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  margin: 2px 3px 2px 0; letter-spacing: .3px;
}
.hd-tag.entry { background: rgba(56,189,248,.10); color: #38bdf8; border: 1px solid rgba(56,189,248,.2); }
.hd-tag.sell  { background: rgba(248,113,113,.10); color: #f87171; border: 1px solid rgba(248,113,113,.2); }

/* 메타 행 */
.hd-meta-row {
  display: flex; gap: 12px; flex-wrap: wrap;
}
.hd-meta-item {
  font-family: var(--font-mono); font-size: 11px; color: var(--text2);
  display: flex; align-items: center; gap: 4px;
}
.hd-meta-val { color: var(--text1); font-weight: 600; }

@media (max-width: 600px) {
  .history-chart-wrap { height: 200px; padding: 8px 4px 4px; }
  .hd-hero-pnl { font-size: 30px; }
  .hd-pf-val { font-size: 12px; }
  .hd-score-label { width: 48px; font-size: 10px; }
}

/* ══════════════════════════════
   모바일 종목 검색
══════════════════════════════ */

/* 탑바 검색 버튼 */
.mobile-search-btn {
  display: none; /* 모바일에서만 표시 */
  background: none; border: none;
  color: var(--text2); cursor: pointer;
  padding: 5px 6px; margin-left: 2px;
  border-radius: var(--r-md);
  align-items: center; justify-content: center;
  transition: color .15s, background .15s;
}
.mobile-search-btn:hover, .mobile-search-btn.active {
  color: var(--accent); background: var(--accent-dim2);
}
@media (max-width: 1023px) {
  .mobile-search-btn { display: flex; }
}

/* 검색 바 패널 (탑바 바로 아래, 기본 숨김) */
.mobile-search-bar {
  display: none;
  position: fixed; left: 0; right: 0; top: 52px;  /* topbar(52) 아래 */
  z-index: calc(var(--z-topbar) - 1);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
}
.mobile-search-bar.open { display: block; }
@media (min-width: 1024px) { .mobile-search-bar { display: none !important; } }

/* 검색 바 내부 레이아웃 */
.mobile-search-wrap {
  display: flex; align-items: center; gap: 10px;
}
.mobile-search-inner {
  position: relative; flex: 1;
}
.mobile-search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text3); pointer-events: none;
}
.mobile-search-input {
  width: 100%; padding: 10px 12px 10px 32px;
  background: var(--bg); border: 1px solid var(--border2);
  border-radius: var(--r-md); color: var(--text1);
  font-family: var(--font-mono); font-size: 13px;
  outline: none; transition: border-color .15s;
  -webkit-appearance: none;
}
.mobile-search-input::placeholder { color: var(--text3); }
.mobile-search-input:focus { border-color: var(--accent); }
.mobile-search-cancel {
  background: none; border: none; color: var(--accent);
  font-family: var(--font-mono); font-size: 12px;
  cursor: pointer; padding: 6px 2px; white-space: nowrap;
  flex-shrink: 0;
}

/* 모바일 자동완성 드롭다운 */
.mobile-search-suggestions {
  position: absolute; left: 0; right: 0; top: calc(100% + 5px);
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r-md); overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  z-index: calc(var(--z-topbar) + 10);
}
.mobile-search-suggestions:empty { display: none; }
.mobile-search-suggestions .search-suggestion-item {
  padding: 10px 14px;
  font-size: 13px;
}


