/* OKAPISCAN 홈 개편 v1 — 첫 화면 압축 + 핵심 지표 상단 노출 + 레퍼럴 동선
   기존 space-home-v5 / nebula-home-v1 위에 마지막으로 덮어쓴다. */

body.space-home .space-hero {
  min-height: 0;
  padding: 34px 0 0;
}
body.space-home .hero-inner {
  padding-top: 0;
  align-items: flex-start;
  gap: 24px;
}
body.space-home .space-hero h1 {
  font-size: clamp(38px, 4.6vw, 60px);
  margin: 10px 0 8px;
  letter-spacing: -.05em;
}
body.space-home .hero-sub {
  font-size: 14px;
  margin: 0 0 14px;
}
body.space-home .hero-right {
  padding-top: 6px;
}
body.space-home .hero-links a {
  padding: 10px 16px;
}

/* 상단 핵심 지표 칩 */
body.space-home .hero-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
  padding-bottom: 18px;
}
body.space-home .hero-metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 14px;
  border: 1px solid #2a415f;
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(11, 28, 52, .92), rgba(5, 13, 27, .92));
}
body.space-home .hero-metric span {
  font-size: 11px;
  letter-spacing: .04em;
  color: #8fa5c4;
}
body.space-home .hero-metric strong {
  font-size: 17px;
  font-weight: 800;
  color: #eef4ff;
  font-variant-numeric: tabular-nums;
}
body.space-home .hero-metric em {
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  color: #93a6c2;
}
body.space-home .hero-metric em.up { color: #3ddc97; }
body.space-home .hero-metric em.down { color: #ff6b7a; }

/* 레퍼럴(거래소 혜택) 동선 */
body.space-home .cta-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 8px auto 18px;
}
body.space-home .cta-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid #2c4463;
  border-radius: 10px;
  text-decoration: none;
  background: linear-gradient(150deg, rgba(10, 25, 48, .95), rgba(6, 15, 30, .95));
  transition: border-color .15s ease, transform .15s ease;
}
body.space-home .cta-card:hover {
  border-color: #4d76a8;
  transform: translateY(-1px);
}
body.space-home .cta-card small {
  font-size: 10px;
  letter-spacing: .08em;
  color: #7f96b6;
  text-transform: uppercase;
}
body.space-home .cta-card b {
  font-size: 15px;
  color: #f2f7ff;
}
body.space-home .cta-card span {
  font-size: 11px;
  color: #9fb6d6;
}
/* 거래소 띠는 ui-polish-v1.css 한 곳에서만 정의한다(여기 있던 3px 규칙은 뒤 로드되는 파일에 항상 덮여 죽은 코드였다). */

body.space-home .home-content {
  margin-top: 0;
}

/* 김치 카드가 한 줄을 다 먹어 화면이 길어지던 것을 4칸 그리드로 압축 */
body.space-home .feature-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body.space-home .feature-kimchi { grid-column: auto; min-height: 300px; }
body.space-home .kc-home-chart { height: 118px; }
body.space-home .premium-big { font-size: 26px; }

@media (max-width: 1199px) {
  body.space-home .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.space-home .feature-kimchi { grid-column: 1 / -1; min-height: 300px; }
  body.space-home .cta-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  body.space-home .feature-grid { grid-template-columns: 1fr; }
  body.space-home .feature-kimchi { grid-column: auto; min-height: 280px; }
  body.space-home .kc-home-chart { height: 130px; }
}

/* 타임프레임 전환 */
body.space-home .section-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
body.space-home .tf-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid #2c4463;
  border-radius: 8px;
  background: rgba(6, 16, 31, .9);
}
body.space-home .tf-switch button {
  border: 0;
  background: transparent;
  color: #93a9c8;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
body.space-home .tf-switch button:hover { color: #dfe9f8; }
body.space-home .tf-switch button.active {
  background: #1c3a63;
  color: #ffffff;
}
body.space-home .stale-note {
  margin: 10px 0 0;
  font-size: 11px;
  color: #f7b955;
}
body.space-home .stale-note[hidden] { display: none; }

/* 증시 요약은 시장 지표 아래 보조 블록으로 */
body.space-home .stock-summary {
  margin-top: 22px;
}

@media (max-width: 850px) {
  body.space-home .space-hero {
    min-height: 0;
    padding-top: 22px;
  }
  body.space-home .hero-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.space-home .cta-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  body.space-home .section-tools {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 600px) {
  body.space-home .space-hero {
    min-height: 0;
    padding-top: 16px;
  }
  body.space-home .space-hero h1 { font-size: clamp(34px, 10vw, 44px); }
  body.space-home .hero-metrics {
    gap: 7px;
    margin-top: 14px;
  }
  body.space-home .hero-metric { padding: 9px 10px; }
  body.space-home .hero-metric strong { font-size: 14px; }
  body.space-home .cta-card { padding: 12px 13px; }
  body.space-home .cta-strip { grid-template-columns: minmax(0, 1fr); }
}

/* 상단 칩 라벨의 타임프레임 표기 */
body.space-home .hero-metric span i {
  font-style: normal;
  font-weight: inherit;
  color: inherit;
}
