/* style.css 3분할 1/3 — 변수·베이스·레이아웃·표·배지·카드·종목상세 (2026-07-23).
   로드 순서 의무: base → mobile → domain (base.html — 캐스케이드 보존). 분할 경계 이동 금지. */
/* ─────────────────────────────────────────────
   RedShot · 단기 매수 타이밍 대시보드
───────────────────────────────────────────── */

/* ── 변수 ── */
:root {
  --primary:      #8B1A1A;   /* RedShot 브랜드 크림슨 */
  --primary-light:#b91c1c;
  --primary-pale: #fef2f2;
  /* 2026-07-02 B+ PR3 — 웜 아이보리 팔레트 (차가운 회청 → 따뜻한 중성).
     크림슨 브랜드·상승 빨강/하락 파랑 관례는 유지. */
  --bg:           #faf9f5;
  --white:        #ffffff;
  --border:       #ddd8cc;
  --border-light: #ece8dd;
  --text:         #1a1a1a;
  --text-muted:   #6b7280;
  --up:           #c0392b;   /* 상승 빨강 (한국 관례) */
  --dn:           #1a6dad;   /* 하락 파랑 */
  --green:        #16a34a;
  --table-head:   #f4f1e9;
  --shadow:       none;              /* PR0 (2026-07-12) — 카드 위계는 1px 보더가 담당, 장식 그림자 제거 */
  --shadow-md:    0 4px 12px rgba(0,0,0,.09);
  --radius:       8px;
  /* 페이퍼 테크니컬 프레임 (PR1, 2026-07-12) — 다크 셸 + 라이트 페이퍼 컨테이너 */
  --shell:        #232019;   /* 페이지 외곽 웜 다크 차콜 (순흑 금지) */
  --shell-line:   #3a352c;
  --shell-text:   #d6d0c4;
  --shell-mute:   #a89f90;
  --radius-lg:    14px;
}

/* ── 리셋 & 베이스 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  /* 최후 안전망 — 어떤 자식 요소가 폭을 초과해도 가로 스크롤 차단.
     clip: hidden과 달리 스크롤 컨테이너를 만들지 않아 sticky(헤더·서브네비) 안전.
     html에 overflow 규칙 추가 금지 — body sticky 전파 특례가 깨진다.
     특정 테이블·카드는 자체 .table-wrap(overflow-x:auto)으로 가로 스크롤 허용. */
  overflow-x: clip;
}
html { overflow-x: clip; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select { font-family: inherit; }

/* ── 컨테이너 ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ── 유틸 ── */
.ta-c { text-align: center; }
.ta-r { text-align: right; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.up   { color: var(--up) !important; }
.dn   { color: var(--dn) !important; }
.neutral { color: var(--text-muted); }
.text-muted  { color: var(--text-muted); font-size: 12px; }
.text-error  { color: var(--up); }
.ml-auto { margin-left: auto; }
.hidden  { display: none; }
.muted   { color: #9ca3af; } /* 폴백·보조 텍스트 — 기존 미정의 잠재 결함 보정 (2026-07-12 audit) */

/* ── 헤더 ── */
.site-header {
  background: #2a251e; /* PR1 — 셸 레이어 (크림슨은 로고·활성 액센트로 이동) */
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--shell-line);
}
.site-header .container {
  display: flex; align-items: center; gap: 24px;
  height: 54px;
}
.logo { font-size: 22px; font-weight: 700; letter-spacing: -1px; display: flex; align-items: center; }
.logo-red   { color: #fff; }
.logo-shot  { color: #e0836f; } /* PR1 — 다크 셸 위 크림슨 액센트 */
.logo-bullseye { width: 0.76em; height: 0.76em; vertical-align: -0.08em; margin: 0 0.02em; flex-shrink: 0; }

.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-link {
  color: rgba(255,255,255,.80);
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-link:hover,
.nav-link.active {
  background: rgba(255,255,255,.18);
  color: #fff;
}
.menu-toggle {
  display: none;
  background: none; border: none;
  flex-direction: column; gap: 5px; padding: 4px;
  margin-left: auto;
}
.menu-toggle span {
  display: block; width: 22px; height: 2px;
  background: #fff; border-radius: 2px;
}

/* ── 시장 지수 바 ── */
.index-bar {
  background: transparent; /* PR1 — 셸 위에 직접 */
  border-bottom: 1px solid var(--shell-line);
  padding: 8px 0;
}
.index-bar .up { color: #e26d5e; } /* 셸 위 가독 보정 */
.index-bar .dn { color: #7fb2e5; }
.index-bar__items {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.index-item { display: flex; align-items: center; gap: 6px; }
.index-name { color: var(--shell-mute); font-size: 12px; }
.index-value { font-weight: 700; font-size: 15px; color: var(--shell-text); }
.index-change { font-size: 12px; }
.index-divider { width: 1px; height: 16px; background: var(--shell-line); }

/* ── 메인 콘텐츠 — 페이퍼 패널 (PR1) — 다크 셸 위 라이트 액자 ── */
.main-content {
  position: relative;
  /* 강제 다크 변환 3중 가드를 패널에 직접 — body가 셸(다크)로 바뀌면서 구 체계(밝은 body 가드)가
     콘텐츠를 못 지키게 됨. 삼성 인터넷 실기기 제보(7/12) 대응: 명시 hex + !important + color-scheme. */
  background: #faf9f5 !important;
  color-scheme: only light; /* 'only' = Chrome/Samsung auto-dark 강제 opt-out (스펙 정식) */
  forced-color-adjust: none;
  max-width: 1240px;
  margin: 14px auto 28px;
  border-radius: 18px;
  border: 1px solid var(--shell-line);
  padding: 22px 0 40px;
}
/* L-브래킷 코너 디테일 — 테크니컬 프레임 시그니처 */
.main-content::before, .main-content::after {
  content: ''; position: absolute; width: 14px; height: 14px; pointer-events: none;
}
.main-content::before { top: -6px; left: -6px; border-top: 2px solid #6b6357; border-left: 2px solid #6b6357; }
.main-content::after  { bottom: -6px; right: -6px; border-bottom: 2px solid #6b6357; border-right: 2px solid #6b6357; }
@media (max-width: 768px) {
  .main-content { margin: 8px 6px 18px; border-radius: 12px; padding: 12px 0 24px; }
}
/* 모노 메타 — 갱신 시각·상태 배지 (테크니컬 디테일) */
.refresh-status, .dash-greet-stamp, .index-name, .live-quote-badge {
  font-family: ui-monospace, 'JetBrains Mono', Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

/* ── 섹션 ── */
.section {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

/* ─────────────────────────────────────────────
   대시보드 디자인 토큰 (Phase A)
   - .dash-hero       : 상단 히어로 (비회원/회원 분기)
   - .dash-card       : 본문 카드 공통 (white bg + subtle border + shadow)
   - .dash-card.accent-* : 좌측 4px 컬러 보더로 강조 (배경 그라디언트 대신)
   - .dash-section-h  : 섹션 제목 통일 패턴
───────────────────────────────────────────── */
.dash-hero {
  position: relative;
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 16px;
  overflow: hidden;
  background: #ffffff; /* PR0 — 그라디언트 평탄화 */
  border: 1px solid #f3d3d3;
  box-shadow: none;
}
.dash-hero::after {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  background: none; /* PR0 — 코너 글로우 제거 */
  pointer-events: none;
}
.dash-hero-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  color: var(--primary); text-transform: uppercase;
}
.dash-hero-title {
  font-size: 22px; font-weight: 800; color: #111827;
  margin: 4px 0 6px; line-height: 1.3;
}
.dash-hero-desc {
  font-size: 13px; color: #4b5563; line-height: 1.6;
}
.dash-hero-cta {
  display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px;
}
.dash-hero-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.dash-hero-kpi {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px 14px;
  position: relative; z-index: 1;
}
.dash-hero-kpi-label {
  font-size: 11px; color: var(--text-muted); font-weight: 600;
}
.dash-hero-kpi-value {
  font-size: 22px; font-weight: 800; color: #111827;
  margin-top: 4px; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.dash-hero-kpi-sub {
  font-size: 11px; color: var(--text-muted); margin-top: 4px;
}
@media (max-width: 768px) {
  .dash-hero { padding: 18px 18px; }
  .dash-hero-title { font-size: 19px; }
  .dash-hero-kpis { grid-template-columns: 1fr; gap: 8px; }
}

/* ─────────────────────────────────────────────
   C안 PR① (2026-07-12) — 히어로 압축
   - .dash-hero--compact : 비회원 히어로 축소판 (KPI 그리드 제거 후 여백 감량)
   - .dash-greet         : 회원 인사 1줄 (지수 요약 market_line + 갱신 스탬프 흡수)
   목표: 첫 화면(PC 900px / 모바일 844px)에 TOP20 표 진입
───────────────────────────────────────────── */
.dash-hero--compact { padding: 18px 22px; margin-bottom: 12px; }
.dash-hero--compact .dash-hero-cta { margin-top: 12px; align-items: center; }
.dash-greet { padding: 12px 2px 2px; margin-bottom: 10px; }
.dash-greet-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.dash-greet-title {
  font-size: 20px; font-weight: 800; color: #111827;
  margin: 0; line-height: 1.3;
}
.dash-greet-mkt {
  font-size: 13px; color: var(--text-muted);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.dash-greet-mkt strong { color: #374151; font-weight: 700; }
.dash-greet-mkt b { font-weight: 700; }
.dash-greet-sep { margin: 0 2px; color: #d1d5db; }
.dash-greet-stamp { margin-left: auto; font-size: 11px; color: #9ca3af; white-space: nowrap; }
.dash-greet-sub { margin: 4px 0 0; font-size: 13px; color: #4b5563; }
@media (max-width: 768px) {
  .dash-greet-title { font-size: 17px; }
  .dash-greet-stamp { display: none; }
  .dash-greet-row { gap: 8px; }
}

/* ─────────────────────────────────────────────
   C안 PR② (2026-07-12) — 오늘 신호 요약 칩
   등급 카드 6종의 첫 화면 요약. 신호 있는 등급만 파스텔 칩,
   0건 등급은 회색 칩 1개. 클릭 → 하단 상세 카드(#buy-cards) 앵커.
   파스텔 = 워시드 배경 + 진한 글자 (강조 위계 2단).
───────────────────────────────────────────── */
.signal-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 2px 0 12px; }
.sig-chip {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 5px 13px;
  font-size: 12.5px; font-weight: 700; text-decoration: none;
  border: 1px solid transparent; color: #374151; line-height: 1.3;
}
.sig-chip b { font-variant-numeric: tabular-nums; font-weight: 800; }
.sig-chip--blast  { background: #f0eaf9; color: #64409c; border-color: #e2d5f2; }
.sig-chip--vcpa   { background: #fdf0e2; color: #9a5b10; border-color: #f5e0c4; }
.sig-chip--pead   { background: #fdebec; color: #9f2f2d; border-color: #f6d4d5; }
.sig-chip--vcpb   { background: #fbf3db; color: #8a5c00; border-color: #f0e4bb; }
.sig-chip--leader { background: #e1f0fa; color: #1f5c8f; border-color: #cbe2f3; }
.sig-chip--normal { background: #edf3ec; color: #346538; border-color: #d8e6d8; }
.sig-chip--ghost  { background: transparent; color: #9ca3af; border-color: var(--border-light); font-weight: 500; }
a.sig-chip:hover { filter: brightness(0.97); }
@media (max-width: 768px) {
  .signal-chips { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .sig-chip { white-space: nowrap; font-size: 12px; }
}

.dash-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(17, 24, 39, .04);
}
.dash-card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 10px;
}
.dash-card-title {
  font-size: 14px; font-weight: 700; color: #111827;
  display: inline-flex; align-items: center; gap: 6px;
}
.dash-card-sub {
  font-size: 11px; color: var(--text-muted); font-weight: 400;
}
.dash-card-action {
  font-size: 12px; color: var(--primary); text-decoration: none; font-weight: 600;
}
.dash-card-action:hover { text-decoration: underline; }
.dash-card-foot {
  margin: 10px 0 0;
  font-size: 10px; color: #9ca3af; line-height: 1.5;
}

/* accent-* 클래스는 후방 호환을 위해 유지하되 시각적으로는 단일 톤으로 통일.
   색상은 "주가 등락률" 외엔 사용하지 않는다는 원칙을 따른다 — 카드 위계는
   제목 굵기·본문 농담·여백으로 표현. */
.dash-card.accent-update,
.dash-card.accent-warm,
.dash-card.accent-achieve,
.dash-card.accent-guest,
.dash-card.accent-primary {
  /* 좌측 컬러 보더 제거 — 인디고/녹색/퍼플/블루 5색 동시 노출이 혼란 유발 */
}
.section-title {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.section-title h2 {
  font-size: 15px; font-weight: 700;
  border-left: 3px solid var(--primary);
  padding-left: 10px;
}
.refresh-status-wrap { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-wrap: wrap; }
/* 모바일에선 status 라벨 + 버튼들이 좁아 글자가 세로로 깨지는 걸 방지 */
.refresh-status-wrap .btn { white-space: nowrap; }
@media (max-width: 768px) {
  .refresh-status-wrap { gap: 8px; margin-left: 0; width: 100%; justify-content: flex-start; }
  .refresh-status-wrap .btn { font-size: 12px; padding: 4px 10px; }
  .refresh-status-wrap .link-more { margin-left: auto; }
}
.link-more { font-size: 12px; color: var(--primary-light); }

/* 자동갱신 상태 표시 */
.refresh-status {
  font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 12px;
  white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
}
.refresh-status.market-open  { background: #dcfce7; color: #15803d; border: 1px solid #4ade80; }
.refresh-status.market-closed { background: #f3f4f6; color: #9ca3af; border: 1px solid #e5e7eb; }

/* 장중 실시간 시세 오버레이 — 보이는 행만 라이브 갱신(main.js initLiveQuotes) */
.live-quote-badge {
  font-size: 11px; font-weight: 600; color: #15803d; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
/* 라이브로 덮어쓴 셀은 등락 색(up/dn)을 유지하되 갱신됨을 미세하게 표시.
   인라인 텍스트 점만 사용(position 의존 X) — 모바일 카드(td position:static !important,
   display:inline-block !important)와 충돌하지 않도록 baseline 정렬. */
td.price-row.live-quote::after {
  content: " •"; color: #16a34a; font-size: 9px; vertical-align: baseline;
}
/* 모바일 카드 뷰에선 라벨·값 인라인 배치라 점 생략 (시각 노이즈 방지) */
@media (max-width: 768px) {
  td.price-row.live-quote::after { content: ""; }
}

/* AI 분석 캐시 뱃지 */
.cache-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: #6b7280; background: #f3f4f6;
  border: 1px solid #e5e7eb; border-radius: 6px;
  padding: 4px 10px; margin-bottom: 10px;
}
.cache-refresh-btn {
  background: none; border: none; color: var(--primary-light);
  font-size: 12px; cursor: pointer; text-decoration: underline; padding: 0;
}
.cache-refresh-btn:hover { color: var(--primary); }
.link-more:hover { text-decoration: underline; }

/* ── 통계 카드 그리드 ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-card.highlight { border-color: var(--primary-light); background: var(--primary-pale); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.stat-value { font-size: 24px; font-weight: 700; line-height: 1.2; }
.stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.four-col { grid-template-columns: repeat(4, 1fr); }

/* ── 2열 레이아웃 ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── 포트폴리오 hero (대시보드 전용) v2 ────────── */
.pf-hero {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--white);
}
.pf-pnl {
  flex: 0 0 36%;
  padding: 22px 26px;
  display: flex; flex-direction: column; justify-content: center;
}
.pf-pnl.up { background: #fdeeee; } /* PR0 — 플랫 */
.pf-pnl.dn { background: #eef5fc; } /* PR0 — 플랫 */
.pf-pnl-label {
  font-size: 12px; color: var(--text-muted);
  font-weight: 600; letter-spacing: .3px;
  margin-bottom: 6px;
}
.pf-pnl-value {
  font-size: 30px; font-weight: 800;
  line-height: 1.15; letter-spacing: -.5px;
  font-variant-numeric: tabular-nums;
}
.pf-pnl.up .pf-pnl-value { color: var(--up); }
.pf-pnl.dn .pf-pnl-value { color: var(--dn); }
.pf-pnl-pct {
  display: inline-block; margin-top: 8px;
  padding: 3px 11px; border-radius: 999px;
  background: rgba(255,255,255,.75);
  font-size: 13px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pf-pnl.up .pf-pnl-pct { color: var(--up); }
.pf-pnl.dn .pf-pnl-pct { color: var(--dn); }
.pf-metrics {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.pf-metric {
  padding: 22px 16px;
  text-align: center;
  border-left: 1px solid var(--border-light);
  display: flex; flex-direction: column; justify-content: center;
}
.pf-metric:first-child { border-left: none; }
.pf-metric-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.pf-metric-value { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pf-metric-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

@media (max-width: 880px) {
  .pf-hero { flex-direction: column; }
  .pf-pnl { flex: none; }
  .pf-metrics { grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border-light); }
  .pf-metric { padding: 14px 8px; }
  .pf-pnl-value { font-size: 24px; }
}

/* ── 보유 주식 — 표 + 도넛 사이드 ────────── */
.holdings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 880px) { .holdings-layout { grid-template-columns: 1fr; } }

.return-cell {
  display: inline-flex; align-items: center; gap: 8px;
  justify-content: flex-end;
}
.return-bar-mini {
  width: 50px; height: 4px; border-radius: 2px;
  background: rgba(0,0,0,.06);
  position: relative; overflow: hidden;
  flex-shrink: 0;
}
.return-bar-mini > i {
  position: absolute; top: 0; bottom: 0;
  border-radius: 2px;
}
.return-bar-mini > i.up { background: var(--up); left: 0; }
.return-bar-mini > i.dn { background: var(--dn); right: 0; }
.return-pct {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  min-width: 60px; text-align: right;
}

.donut-side {
  background: #fafbfc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.donut-side-title {
  font-size: 12px; color: var(--text-muted);
  font-weight: 600; letter-spacing: .3px;
  text-align: center; margin-bottom: 10px;
}
.donut-side .chart-wrap {
  height: 170px;
  margin-bottom: 10px;
}
.donut-list {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 200px; overflow-y: auto;
  list-style: none; padding: 0; margin: 0;
}
.donut-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 6px; border-radius: 4px;
  font-size: 12px;
}
.donut-list li:hover { background: rgba(0,0,0,.04); }
.donut-list .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.donut-list .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-list .pct { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }

/* ── 보유 종목 수익률 — 가로 막대 차트 ────────── */
.return-chart-wrap {
  position: relative;
  width: 100%;
  /* 종목 수에 따라 JS에서 height를 동적 조정 */
}

/* ── 차트 ── */
.chart-wrap { position: relative; height: 200px; }
.chart-wrap.tall { height: 260px; }
.chart-wrap.price-chart-wrap { height: 340px; }

/* ── 표 ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* 넓은 테이블용 상단 가로 스크롤바 미러 — 페이지 하단까지 내리지 않고 좌우 이동.
   JS가 data-scroll-mirror="tableId"로 타겟 테이블과 폭·스크롤 동기화. */
.table-scroll-top {
  overflow-x: auto;
  overflow-y: hidden;
  height: 14px;
  margin-bottom: 2px;
  background: transparent;
}
.table-scroll-top > div { height: 1px; }
/* 스크롤바 가시성 향상 — 기본 얇은 스크롤바는 놓치기 쉬움 */
.table-scroll-top::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar { height: 12px; }
.table-scroll-top::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb {
  background: #9ca3af;
  border-radius: 6px;
  border: 2px solid #f9fafb;
}
.table-scroll-top::-webkit-scrollbar-thumb:hover,
.table-wrap::-webkit-scrollbar-thumb:hover { background: #6b7280; }
.table-scroll-top::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track { background: #f3f4f6; border-radius: 6px; }
/* 대시보드 TOP 15 등 14 컬럼 테이블 전용 — 노트북 폭(1280px 이하)에서
   가로 스크롤 방지 위해 padding·font 축소. stocks.html 스크리너는 영향 없음.
   1499px 이하에서는 hide-tablet으로 추가 컬럼 숨김(이평선·Pre-Surge·PEAD·손절가).
   잔여 폭 초과 가능성 차단을 위해 .compact 본인은 가로 스크롤 자체 차단(잘림 허용). */
.table-wrap.compact { overflow-x: hidden; }
.table-wrap.compact .data-table { font-size: 12px; table-layout: auto; }
.table-wrap.compact .data-table th,
.table-wrap.compact .data-table td { padding: 6px 7px; }
/* 종목명 컬럼은 가장 긴 텍스트라 폭의 큰 부분을 차지. 노트북 폭에서 ellipsis로 잘라
   다른 컬럼이 밀려 가로 스크롤 유발하는 것 방지. analysis 페이지에서 풀네임 확인 가능. */
.table-wrap.compact .data-table .stock-name-link { max-width: 180px; }
.table-wrap.compact .data-table .stock-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: inline-block; max-width: 160px; vertical-align: bottom;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  background: var(--table-head);
  padding: 9px 12px;
  font-weight: 600; font-size: 12px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  color: var(--text-muted);
  user-select: none;
}
.data-table th.sortable-col { transition: background .15s; }
.data-table th.sortable-col:hover { background: #fce8e8; color: var(--primary); }
.data-table th.sort-asc,
.data-table th.sort-desc { background: var(--primary-pale); color: var(--primary); }
.th-label { }
.sort-icon { margin-left: 4px; font-size: 11px; color: #aaa; }
.sort-asc  .sort-icon,
.sort-desc .sort-icon { color: var(--primary); }
.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
.row-hover:hover { background: #fff0f0; cursor: pointer; }
.table-note { font-size: 11px; color: var(--text-muted); margin-top: 8px; }

.stock-name-link { display: flex; flex-direction: column; gap: 1px; }
.stock-name { font-weight: 600; }
.stock-code { font-size: 11px; color: var(--text-muted); }
.rank-num { font-weight: 700; color: var(--primary); }

.detail-table th { text-align: left; width: 140px; background: var(--table-head); font-size: 13px; }
.detail-table td { width: 120px; }

/* ── 배지 ── */
.market-badge {
  display: inline-block;
  padding: 2px 7px; border-radius: 4px;
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
  white-space: nowrap;
}
/* KOSPI/KOSDAQ 시장 구분 — 기존 파란/노란 컬러 뱃지 → 옅은 회색 통일.
   시장 구분은 식별용 정보일 뿐 강조 대상이 아니라 색을 줄이는 게 더 깔끔하다.
   글자만으로 "KOSPI"/"KOSDAQ"이 충분히 구분된다. */
.market-badge.kospi,
.market-badge.kosdaq { background: #f3f4f6; color: #6b7280; }

/* 보유 종목 스크리닝 / 실시간 메타 라인 */
.screening-meta {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px;
}
.smeta-item {
  font-size: 11px; padding: 1px 6px; border-radius: 4px;
  background: var(--bg-secondary, #f1f5f9); color: var(--text-muted);
  white-space: nowrap;
}
.smeta-item.rank   { background: #dbeafe; color: #1d4ed8; font-weight: 700; }
.smeta-item.pead   { background: #fef3c7; color: #b45309; font-weight: 700; }
.smeta-item.realtime { background: #f0fdf4; color: #15803d; font-weight: 600; }

.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 12px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.badge-blue   { background: var(--primary-pale); color: var(--primary); }
.badge-red    { background: #fde8e8; color: var(--up); }
.badge-green  { background: #dcfce7; color: #16a34a; }
.badge-yellow { background: #fef9c3; color: #a16207; }
/* EMA 추세 칩(정배열/역배열/혼조)은 종목 목록에 빈도가 높아 배경 제거 — 폰트색만으로 식별. */
.badge-gray   { background: transparent; color: #6b7280; }
.badge-up     { background: transparent; color: #c0392b; font-weight: 700; }
.badge-down   { background: transparent; color: #1d4ed8; font-weight: 700; }
.badge-empty  { color: var(--text-muted); }
/* 🌱 신규 발굴 — Warm-tier 흡수 종목 (1단계 풀 확장).
   기존 등급 배지와 병기되므로 옅은 녹색·테두리 강조로 시각 충돌 최소화. */
.badge-warm-tier {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #86efac;
  padding: 1px 7px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
.rank-badge { background: var(--primary-pale); color: var(--primary); padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.dividend-badge { background: #f0fdf4; color: var(--green); padding: 2px 8px; border-radius: 10px; font-size: 12px; }
/* 포트폴리오 보완 추천 카드 — 대시보드 4번 섹션 */
.reco-card {
  margin-top: 16px;
  background: #f0f9ff; /* PR0 — 플랫 */
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 16px 18px;
}
.reco-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin-bottom: 14px;
}
.reco-title { font-size: 15px; font-weight: 700; color: #0c4a6e; margin: 0; }
.reco-desc  { font-size: 12px; color: #475569; margin: 3px 0 0; line-height: 1.45; }
.reco-badge {
  background: #fff; border: 1px solid #bae6fd; color: #0369a1;
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 10px;
  white-space: nowrap; flex-shrink: 0;
}
.reco-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.reco-item {
  display: block;
  background: #fff;
  border: 1px solid #e0f2fe;
  border-radius: 10px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.reco-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, .12);
  border-color: #38bdf8;
}
.reco-item-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.reco-name { font-size: 14px; font-weight: 700; color: #0f172a; }
.reco-code { font-size: 11px; color: #94a3b8; font-family: ui-monospace, monospace; }
.reco-reason {
  font-size: 12px; color: #334155; line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.reco-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.reco-price { font-size: 12px; color: #475569; font-family: ui-monospace, monospace; }
.reco-er { font-size: 11px; color: #6b7280; font-weight: 600; }
.reco-er.hi { color: #16a34a; }

@media (max-width: 640px) {
  .reco-grid { grid-template-columns: 1fr; }
}

/* 매도/손절 상태 칩 — 보유 종목 행의 4종 신호 표기 (🔴/🟠/🟣/🟡) */
.sell-chip {
  display: inline-block;
  font-size: 14px;
  line-height: 1;
  padding: 2px 1px;
  cursor: help;
  vertical-align: middle;
}
.sell-chip + .sell-chip { margin-left: 2px; }
.sell-chip.ok { color: #d1d5db; font-size: 12px; font-weight: 700; }

.invest-badge { padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.invest-badge.short { background: #fde8e8; color: #c0392b; }
.invest-badge.long  { background: #dbeafe; color: #1d4ed8; }
.invest-badge.both  { background: #fef3c7; color: #92400e; }
.invest-badge.watch { background: #f3f4f6; color: #6b7280; }
.invest-period { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.invest-type-card {
  border-radius: 12px;
  padding: 14px 18px;
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid #eef0f3;
  border-left-width: 3px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.invest-type-card.short { border-left-color: #dc2626; }
.invest-type-card.long  { border-left-color: #2563eb; }
.invest-type-card.both  { border-left-color: #ea580c; }
.invest-type-card.watch { border-left-color: #9ca3af; }
.invest-type-card .it-icon { font-size: 26px; }
.invest-type-card .it-label { font-size: 11px; color: #6b7280; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }
.invest-type-card .it-value { font-size: 18px; font-weight: 700; color: #111827; }
.invest-type-card.short .it-value { color: #dc2626; }
.invest-type-card.long  .it-value { color: #2563eb; }
.invest-type-card.both  .it-value { color: #ea580c; }
.invest-type-card .it-period { font-size: 12.5px; margin-top: 3px; color: #4b5563; }

/* ── 감성 온도계 ── */
.sentiment-box { text-align: center; }
.sentiment-label-row { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 10px; }
.sentiment-emoji { font-size: 28px; }
.sentiment-text { font-size: 16px; font-weight: 700; }
.sentiment-pct { font-size: 22px; font-weight: 700; color: var(--primary); }
.thermometer-track {
  width: 100%; height: 12px;
  background: #e5e7eb; border-radius: 6px; overflow: hidden;
  margin: 8px 0;
}
.thermometer-fill {
  height: 100%;
  background: linear-gradient(90deg, #2e73b5 0%, #facc15 50%, #c0392b 100%);
  border-radius: 6px;
  transition: width .5s;
}
.thermometer-track.mini { height: 8px; flex: 1; }
.thermometer-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }
.pead-info { margin-top: 14px; font-size: 13px; }

/* ── 종목별 뉴스 그리드 ── */
.stock-news-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  margin-top: 4px;
}
.stock-news-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: #fff;
}
.stock-news-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.stock-news-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stock-news-name:hover { color: var(--primary); }
.stock-news-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.news-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}
.news-icon {
  font-size: 10px;
  font-weight: 700;
  margin-top: 3px;
  flex-shrink: 0;
  width: 12px;
  text-align: center;
}
.news-icon.news-up    { color: #16a34a; }
.news-icon.news-neu-p { color: #65a30d; }
.news-icon.news-neu   { color: #9ca3af; }
.news-icon.news-dn    { color: #dc2626; }
.news-body { min-width: 0; }
.news-title {
  display: block;
  font-size: 12px;
  color: var(--text);
  text-decoration: none;
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.news-title:hover { color: var(--primary); text-decoration: underline; }
.news-meta {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.news-loading, .news-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 0;
}

.sentiment-bar-mini {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0 14px; font-size: 13px; flex-wrap: wrap;
}
.sentiment-dot {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%; background: #ccc; vertical-align: middle;
  margin-right: 4px;
}
.sentiment-dot.positive     { background: var(--up); }
.sentiment-dot.neutral-pos  { background: #f59e0b; }
.sentiment-dot.neutral      { background: #9ca3af; }
.sentiment-dot.negative     { background: var(--dn); }

.mini-bar-wrap { display: flex; align-items: center; gap: 6px; }
.mini-bar { height: 6px; background: var(--primary-light); border-radius: 3px; transition: width .3s; }

/* ── 필터 pills ── */
.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  padding: 3px 10px; border-radius: 12px; font-size: 12px;
  background: #e5e7eb; color: var(--text-muted);
}
.pill-active { background: var(--primary-pale); color: var(--primary); font-weight: 600; }

/* ── 종목 헤더 ── */
.stock-header { margin-bottom: 16px; }
.stock-header-top { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; }
.stock-header-code { font-size: 12px; color: var(--text-muted); }
.stock-header-name { font-size: 22px; font-weight: 700; margin: 2px 0; }
.sector-tag { background: var(--primary-pale); color: var(--primary); padding: 2px 10px; border-radius: 10px; font-size: 12px; }
.stock-price-block { text-align: right; }
.stock-big-price { font-size: 30px; font-weight: 700; }
.stock-big-price .unit { font-size: 14px; font-weight: 400; color: var(--text-muted); }
.stock-change { font-size: 16px; font-weight: 600; }

/* ── 신호 리스트 ── */
.signal-list { display: flex; flex-direction: column; gap: 14px; }
.signal-item { display: flex; gap: 12px; padding: 12px; border-radius: var(--radius); background: var(--bg); }
.signal-item.signal-active { background: #fef3f2; border-left: 3px solid var(--up); }
.signal-icon { font-size: 20px; flex-shrink: 0; }
.signal-title { font-weight: 600; font-size: 13px; }
.signal-desc { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

/* ── AI 박스 ── */
.ai-box { background: var(--bg); border-radius: var(--radius); padding: 16px; }
.ai-result { margin-top: 12px; line-height: 1.8; font-size: 14px; }

/* ── 버튼 ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600;
  border: none; transition: all .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary-pale); }
.btn-outline.active { background: var(--primary); color: #fff; }
.btn-lg { padding: 10px 28px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── 알림 설정 폼 ── */
.settings-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 14px;
  overflow: hidden;
}
.settings-card-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  background: var(--table-head);
  border-bottom: 1px solid var(--border-light);
}
.settings-card-header h3 { font-size: 14px; font-weight: 700; flex: 1; }
.settings-icon { font-size: 18px; }
.settings-card-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }

.form-row { display: flex; align-items: center; gap: 12px; }
.form-row label { min-width: 90px; font-size: 13px; color: var(--text-muted); }
.form-input {
  flex: 1; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; outline: none;
  transition: border-color .15s;
}
.form-input:focus { border-color: var(--primary-light); }
.time-input { flex: 0 0 100px; }

.schedule-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.alert-options { display: flex; flex-direction: column; gap: 10px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); }

.toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: #ccc; border-radius: 22px; cursor: pointer;
  transition: .2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s;
}
input:checked + .toggle-slider { background: var(--primary); }
input:checked + .toggle-slider::before { transform: translateX(18px); }

.form-actions { display: flex; align-items: center; gap: 14px; padding: 8px 0; }
.test-result { font-size: 13px; }
.test-result.success { color: var(--green); }
.alert { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; }
.alert-error { background: #fde8e8; color: var(--up); }

/* ── 매수 신호 카드 그리드 ── */
.buy-signal-grid { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.buy-signal-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; padding: 2px 2px 4px;
}
.buy-signal-header .title {
  font-size: 14px; font-weight: 700; color: #111827;
  display: flex; align-items: center; gap: 6px;
}
.buy-signal-header .count-muted { font-size: 12px; color: #6b7280; font-weight: 500; }

.buy-signal-tier { display: flex; flex-wrap: wrap; gap: 10px; }

.buy-signal-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid; border-radius: var(--radius-lg);
  background: #fff; transition: box-shadow 0.15s, transform 0.15s;
  min-height: 60px;
}
.buy-signal-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.07); transform: translateY(-1px); }
.buy-signal-card .card-icon { font-size: 20px; flex-shrink: 0; line-height: 1; padding-top: 2px; }
.buy-signal-card .card-body { flex: 1; min-width: 0; }
.buy-signal-card .card-title {
  font-size: 13px; font-weight: 700; line-height: 1.3;
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
}
.buy-signal-card .card-title .count-badge {
  font-size: 10.5px; font-weight: 600; padding: 1px 7px;
  border-radius: 999px; background: rgba(0,0,0,0.08); color: #4b5563;
}
.buy-signal-card .card-desc {
  font-size: 11px; color: #6b7280; margin: 3px 0 6px; line-height: 1.4;
}
.buy-signal-card .card-stocks { display: flex; flex-wrap: wrap; gap: 5px; font-size: 12px; }
.buy-signal-card .stock-chip {
  font-weight: 600; padding: 2px 8px; border-radius: 4px; text-decoration: none;
}
.buy-signal-card .stock-chip:hover { text-decoration: underline; opacity: 0.85; }
.buy-signal-card .more-muted { font-size: 11px; color: #9ca3af; align-self: center; }

/* 티어별 사이즈 */
.buy-signal-tier.tier-1 .buy-signal-card { flex: 1 1 100%; padding: 16px 18px; min-height: 70px; }
.buy-signal-tier.tier-1 .card-icon { font-size: 26px; padding-top: 0; }
.buy-signal-tier.tier-1 .card-title { font-size: 15px; }
.buy-signal-tier.tier-1 .card-desc { font-size: 12px; }
.buy-signal-tier.tier-1 .card-stocks { font-size: 13px; }

.buy-signal-tier.tier-2 .buy-signal-card { flex: 1 1 calc(50% - 5px); min-width: 280px; }

.buy-signal-tier.tier-3 .buy-signal-card {
  flex: 1 1 calc(33.333% - 7px); min-width: 220px;
  padding: 10px 12px; min-height: 50px;
}
.buy-signal-tier.tier-3 .card-icon { font-size: 17px; padding-top: 1px; }
.buy-signal-tier.tier-3 .card-title { font-size: 12px; }
.buy-signal-tier.tier-3 .card-desc { display: none; }
/* leader 카드는 desc에 솔직 운용 가이드("이미 오른 종목군..."추세 추종)가 들어 있어
   PC에서도 항상 노출 — 사용자 신뢰 인프라(B-4, 2026-05-07). tier-3 컴팩트 디자인
   예외 1건. */
.buy-signal-tier.tier-3 .card-leader .card-desc { display: block; font-size: 11px; line-height: 1.45; color: var(--text-muted); margin-top: 4px; }
.buy-signal-tier.tier-3 .card-stocks { font-size: 11px; }
.buy-signal-tier.tier-3 .card-title .count-badge { font-size: 10px; padding: 0 6px; }

/* 등급별 시각 차별화는 card-icon(이모지)으로만 — 배경/제목 색상은 통일.
   목적: 한 화면에 6가지 색상 카드가 동시 노출되던 알록달록함 제거.
   사용자는 이모지(🟣🟠🔴🟡🚀🟢)로 등급을 구분하고, 색은 "주가 등락률" 외엔 안 씀.
   stock-chip은 모두 옅은 회색 + 검정 텍스트로. */
.card-blast,
.card-vcp-a,
.card-strong,
.card-vcp-b,
.card-leader,
.card-normal {
  border-color: var(--border-light);
  background: var(--white);
}
.card-blast .card-title,
.card-vcp-a .card-title,
.card-strong .card-title,
.card-vcp-b .card-title,
.card-leader .card-title,
.card-normal .card-title {
  color: #111827;
}
.card-blast .stock-chip,
.card-vcp-a .stock-chip,
.card-strong .stock-chip,
.card-vcp-b .stock-chip,
.card-leader .stock-chip,
.card-normal .stock-chip {
  background: #f3f4f6;
  color: #374151;
}

/* BLAST 등급은 "홈런 후보 ★" 플래그십이라 미세한 강조만 유지 — 배경 대신
   브랜드 크림슨 톤의 펄스 보더 1px. 다른 등급은 펄스 없음. */
.card-blast {
  animation: pulse-border-blast 2.4s infinite;
}
@keyframes pulse-border-blast {
  0%, 100% { border-color: var(--border-light); box-shadow: var(--shadow); }
  50%      { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(139, 26, 26, .12); }
}

/* 모바일: 1열 스택 */
@media (max-width: 640px) {
  .buy-signal-tier.tier-2 .buy-signal-card,
  .buy-signal-tier.tier-3 .buy-signal-card { flex: 1 1 100%; min-width: 0; }
  .buy-signal-tier.tier-3 .card-desc { display: block; }
  .buy-signal-tier.tier-1 .buy-signal-card { padding: 12px 14px; }
  .buy-signal-tier.tier-1 .card-icon { font-size: 22px; }
}

.btn-sm { padding: 5px 12px; font-size: 12px; }

.buy-signal-row {
  background: #f4fbf5 !important; /* PR0 — 플랫 틴트 */
  border-left: 3px solid #16a34a;
}
.buy-signal-row:hover { background: #dcfce7 !important; }
.strong-signal-row {
  background: #fdf5f5 !important; /* PR0 — 플랫 틴트 */
  border-left: 3px solid #dc2626;
}
.strong-signal-row:hover { background: #fee2e2 !important; }
.vcp-a-signal-row {
  background: #fdf8f0 !important; /* PR0 — 플랫 틴트 */
  border-left: 3px solid #fb923c;
}
.vcp-a-signal-row:hover { background: #ffedd5 !important; }
.vcp-b-signal-row {
  background: #fdfaef !important; /* PR0 — 플랫 틴트 */
  border-left: 3px solid #facc15;
}
.vcp-b-signal-row:hover { background: #fef9c3 !important; }
.buy-dot { margin-right: 3px; }

/* 내 보유 종목 하이라이트 */
.my-holding-row {
  background: #fdfaef !important; /* PR0 — 플랫 틴트 */
  border-left: 3px solid #eab308;
}
.my-holding-row:hover { background: #fef9c3 !important; }
.my-holding-row.buy-signal-row {
  background: #f7fbef !important; /* PR0 — 플랫 틴트 */
  border-left: 3px solid #16a34a;
  border-right: 3px solid #eab308;
}
.my-badge {
  color: #eab308;
  font-size: 12px;
  margin-right: 2px;
}

/* ── 진입/손절/목표가 ── */
.price-col th, .price-col td { white-space: nowrap; }
.price-col.entry th { color: var(--primary); }
.price-col.stop  th { color: var(--up); }
.price-col.target th { color: var(--green); }
.price-pct { display: block; font-size: 11px; }

.price-trio {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.price-trio-card {
  position: relative;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 18px 14px 14px;
  text-align: center;
  border: 1px solid #eef0f3;
  box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.03);
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.price-trio-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.price-trio-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16,24,40,.06), 0 2px 4px rgba(16,24,40,.04);
}
.price-trio-card.entry::before  { background: var(--primary-light); }
.price-trio-card.stop::before   { background: #ef4444; }
.price-trio-card.target::before { background: #10b981; }
.price-trio-card.rr::before     { background: #eab308; }

.price-trio-label { font-size: 11px; color: #6b7280; margin-bottom: 8px; font-weight: 600; letter-spacing: 0.02em; }
.price-trio-value { font-size: 20px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; color: #111827; }
.price-trio-card.stop .price-trio-value   { color: #dc2626; }
.price-trio-card.target .price-trio-value { color: #059669; }
.price-trio-card.entry .price-trio-value  { color: var(--primary); }
.price-trio-value .unit { font-size: 12px; font-weight: 400; color: #9ca3af; }
.price-trio-sub { font-size: 11.5px; color: #6b7280; margin-top: 6px; }

/* ── 종목 상세: 매수 등급 배지 (hero) ── */
.grade-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 700;
  padding: 4px 12px; border-radius: 20px;
  margin-left: 4px;
  border: 1px solid;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  animation: grade-glow 2.4s ease-in-out infinite;
}
.grade-chip--blast  { background:#faf5ff; color:#7e22ce; border-color:#d8b4fe; }
.grade-chip--vcp-a  { background:#fff7ed; color:#c2410c; border-color:#fdba74; }
.grade-chip--strong { background:#fef2f2; color:#dc2626; border-color:#fca5a5; }
.grade-chip--vcp-b  { background:#fefce8; color:#a16207; border-color:#fde68a; }
.grade-chip--normal { background:#f0fdf4; color:#15803d; border-color:#86efac; }
.grade-chip--leader { background:#faf5ff; color:#7c3aed; border-color:#d8b4fe; animation: none; }

/* glow를 완화 — currentColor alpha 불가능하므로 색상별 alpha ring 별도 지정 */
.grade-chip--vcp-a  { --ring: rgba(251,146,60,0.25); }
.grade-chip--strong { --ring: rgba(239,68,68,0.25); }
.grade-chip--vcp-b  { --ring: rgba(250,204,21,0.3); }
.grade-chip--normal { --ring: rgba(74,222,128,0.3); }
.grade-chip--blast  { --ring: rgba(168,85,247,0.25); }
@keyframes grade-glow {
  0%, 100% { box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 0 0 0 var(--ring, transparent); }
  50%      { box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 0 0 4px var(--ring, transparent); }
}

/* ── 종목 상세: 툴팁 힌트 아이콘 ── */
.info-hint {
  display: inline-block; cursor: help;
  font-size: 11px; opacity: .55; margin-left: 2px;
  font-weight: 400; user-select: none;
}

/* ── 종목 상세: 2:1 레이아웃 (차트 + 신호) ── */
.analysis-split {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 900px) { .analysis-split { grid-template-columns: 1fr; } }

/* ── 종목 상세: 공통 분석 카드 (예상 수익률·Pre-Surge 등) ── */
.analysis-card {
  position: relative;
  padding: 18px 20px;
  border: 1px solid #eef0f3;
  border-radius: 12px;
  margin-bottom: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.03);
}
.analysis-card::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0;
  width: 3px; border-radius: 12px 0 0 12px;
  background: transparent;
}
.analysis-card.tint-violet::before { background: #8b5cf6; }
.analysis-card.tint-orange::before { background: #f97316; }
.analysis-card.tint-green::before  { background: #10b981; }
.analysis-card.tint-blue::before   { background: #3b82f6; }
.analysis-card.tint-gray::before   { background: #d1d5db; }

.analysis-card-head {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 10px;
}
.analysis-card-head h3 {
  font-size: 15px; margin: 0; color: #1f2937; font-weight: 700;
}
.analysis-card-head .subtle {
  font-size: 11px; font-weight: 400; color: #6b7280;
}
.analysis-card-head .spacer { flex: 1; }
.analysis-card-head .big-metric {
  font-size: 28px; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.analysis-card-head .big-metric.c-violet { color: #7c3aed; }
.analysis-card-head .big-metric.c-orange { color: #c2410c; }
.analysis-card-head .big-metric.c-green  { color: #16a34a; }
.analysis-card-head .big-metric.c-blue   { color: #1d4ed8; }
.analysis-card-head .big-metric.c-gray   { color: #374151; }
.analysis-card-head .big-metric.c-muted  { color: #9ca3af; }
.analysis-card-head .big-metric .denom { font-size: 12px; color: #6b7280; font-weight: 600; margin-left: 2px; }

/* breakdown-grid: 여러 컴포넌트를 카드로 펼쳐 보여줄 때 (예상 수익률·Pre-Surge 공유) */
.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.breakdown-item {
  padding: 11px 13px;
  background: #fff; border: 1px solid #eef0f3;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(16,24,40,.03);
  transition: transform .15s, box-shadow .15s;
}
.breakdown-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(16,24,40,.05);
  border-color: #e5e7eb;
}
.breakdown-item .b-label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 10.5px; color: #6b7280; margin-bottom: 4px; font-weight: 600;
}
.breakdown-item .b-label .b-weight { font-size: 10px; color: #9ca3af; font-weight: 500; }
.breakdown-item .b-value {
  font-size: 15px; font-weight: 700; color: #1f2937;
  font-variant-numeric: tabular-nums;
}
.breakdown-item .b-value.up    { color: #c2410c; }
.breakdown-item .b-value.dn    { color: #2563eb; }
.breakdown-item .b-value.green { color: #16a34a; }
.breakdown-item .b-value.red   { color: #dc2626; }
.breakdown-item .b-value.muted { color: #9ca3af; }
.breakdown-item .b-meta {
  font-size: 10px; color: #9ca3af; margin-top: 3px; line-height: 1.4;
}
.breakdown-item .b-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 6px;
}
.breakdown-item .b-bar {
  height: 6px; background: #f3f4f6; border-radius: 3px;
  overflow: hidden; margin: 6px 0;
}
.breakdown-item .b-bar-fill {
  height: 100%; background: #0ea5e9; transition: width .3s;
}
.breakdown-item .b-bar-fill.strong { background: #1d4ed8; }
.breakdown-item .b-bar-fill.weak   { background: #94a3b8; }
.breakdown-item .b-bar-fill.empty  { background: #e5e7eb; }

.analysis-footnote {
  margin: 0; font-size: 11px; color: #6b7280; line-height: 1.5;
}

/* 인라인 배지 (Pre-Surge 통과 · surge HOT/WARM/WATCH) */
.inline-pill {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}
.inline-pill--blue   { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.inline-pill--red    { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.inline-pill--orange { background: #fff7ed; color: #ea580c; border-color: #fed7aa; }
.inline-pill--gray   { background: #f3f4f6; color: #6b7280; border-color: #e5e7eb; }
.inline-pill--solid-red    { background: #dc2626; color: #fff; border-color: #dc2626; }
.inline-pill--solid-orange { background: #f59e0b; color: #fff; border-color: #f59e0b; }
.inline-pill--solid-gray   { background: #6b7280; color: #fff; border-color: #6b7280; }

/* 접이식 details — 기본 꾸밈 */
details.analysis-details {
  padding: 10px 14px;
  border: 1px solid #eef0f3;
  border-radius: 10px;
  background: #fafbfc;
  margin-bottom: 10px;
  transition: background .15s;
}
details.analysis-details[open] { background: #fff; border-color: #e5e7eb; }
details.analysis-details > summary {
  cursor: pointer; list-style: none; outline: none;
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: #6b7280;
  padding: 2px 0;
  transition: color .15s;
}
details.analysis-details:hover > summary { color: #374151; }
details.analysis-details[open] > summary { color: #374151; }
details.analysis-details > summary::-webkit-details-marker { display: none; }
details.analysis-details > summary::marker { content: ''; }
details.analysis-details > summary .caret {
  margin-left: auto; font-size: 11px; color: #9ca3af;
  transition: transform .2s;
}
details.analysis-details[open] > summary .caret { transform: rotate(180deg); }
details.analysis-details[open] > summary { margin-bottom: 10px; }
details.analysis-details > .details-body > :last-child { margin-bottom: 0; }

/* ── 푸터 ── */
.site-footer {
  background: #1d1a15; /* PR1 — 셸 톤 */
  color: rgba(255,255,255,.45);
  text-align: center;
  font-size: 12px;
  padding: 14px 0;
}

