/* 테크니컬 상세 — Konsta iOS 톤(그룹 inset 카드·세그먼트·리스트 행·pill 배지). main.css 변수 재사용. */

#tech-card { padding: 14px; }

/* 상단 쉬운 한줄요약 박스 — 틀 강조선 없이 은은한 틴트만 (Konsta iOS 톤) */
.tech-headline {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin: 0 0 14px; padding: 11px 13px;
  background: rgba(120,120,128,.10); border-radius: 12px;
  font-size: 13px; line-height: 1.5;
}
.tech-headline-label {
  flex: 0 0 auto; padding: 2px 8px; border-radius: 6px;
  background: rgba(120,120,128,.16); color: var(--sub);
  font-size: 10.5px; font-weight: 700; letter-spacing: .2px;
}
.tech-headline-text { color: var(--text); font-weight: 500; }

/* 진입 스태거 — 블록마다 --i 순번만큼 지연해 아래로 페이드슬라이드 (은은한 iOS) */
.tech-anim {
  opacity: 0;
  animation: techFadeUp .42s cubic-bezier(.2,.8,.2,1) forwards;
  animation-delay: calc(var(--i, 0) * .06s);
}
@keyframes techFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* 게이지 채움 — dash 총량(--len)만큼 감춰뒀다 좌→우로 그려짐 */
.tech-gauge-arc {
  stroke-dasharray: var(--len);
  stroke-dashoffset: var(--len);
  animation: techArcDraw .8s cubic-bezier(.2,.8,.2,1) .05s forwards;
}
@keyframes techArcDraw { to { stroke-dashoffset: 0; } }
/* 끝점 — arc 다 그린 뒤 살짝 페이드인 */
.tech-gauge-dot { opacity: 0; animation: techDotIn .3s ease .62s forwards; }
@keyframes techDotIn { to { opacity: 1; } }
/* 모션 최소화 시 진입 애니 전부 끔(즉시 최종 상태) — 카운트업은 JS 에서 별도 차단 */
@media (prefers-reduced-motion: reduce) {
  .tech-anim { opacity: 1; animation: none; }
  .tech-gauge-arc { stroke-dashoffset: 0; animation: none; }
  .tech-gauge-dot { opacity: 1; animation: none; }
}

.tech-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; margin-bottom: 12px;
}
.tech-title { font-size: 17px; font-weight: 800; color: var(--text); letter-spacing: -.3px; }
.tech-asof { font-size: 11.5px; color: var(--sub); }

/* 타임프레임 세그먼트 토글 — iOS segmented */
.tech-seg {
  display: inline-flex; background: rgba(120,120,128,.12); border: 0;
  border-radius: 9px; padding: 2px; gap: 2px; margin-bottom: 14px;
}
/* 심볼 토글(SPX/NDX)과 우측 기간 토글(1D/1W/1M) 사이 간격 — 겹침 방지 */
.tech-sym { margin-right: 12px; }
.tech-seg button {
  border: 0; background: transparent; color: var(--text);
  font-size: 12.5px; font-weight: 600; padding: 6px 15px;
  border-radius: 7px; cursor: pointer; transition: background .15s;
}
.tech-seg button.active { background: var(--card, #fff); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.14); font-weight: 700; }

/* 요약 게이지 — iOS 카드 */
.tech-summary {
  display: flex; align-items: center; gap: 16px;
  padding: 14px; margin-bottom: 16px;
  background: var(--card, #fff); border: 1px solid var(--sep); border-radius: 16px;
}
.tech-gauge { flex: 0 0 auto; }
.tech-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tech-label { font-size: 20px; font-weight: 800; line-height: 1.1; letter-spacing: -.4px; }
.tech-score-line { font-size: 12px; color: var(--sub); }
.tech-score-line b { color: var(--text); font-size: 13px; }
.tech-counts { display: flex; gap: 10px; margin-top: 5px; font-size: 11px; flex-wrap: wrap; }
.tech-counts span { display: inline-flex; align-items: center; gap: 5px; color: var(--sub); }
.tech-counts i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; font-style: normal; }

/* 섹션 라벨 — iOS 그룹 헤더 */
.tech-sec-label {
  font-size: 12.5px; font-weight: 600; color: var(--sub);
  margin: 18px 0 7px; padding-left: 4px; letter-spacing: -.1px;
}

/* 지표 표 — iOS inset 리스트 카드 */
.tech-table {
  display: flex; flex-direction: column;
  background: var(--card, #fff); border: 1px solid var(--sep); border-radius: 16px;
  overflow: hidden;
}
.tech-row {
  display: grid; grid-template-columns: 1fr auto 68px; align-items: center;
  gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--sep);
}
.tech-row:last-child { border-bottom: 0; }
.tech-name { font-size: 13.5px; color: var(--text); font-weight: 500; }
.tech-val { font-size: 13px; color: var(--sub); text-align: right; font-variant-numeric: tabular-nums; }
.tech-sig {
  justify-self: end; font-size: 11.5px; font-weight: 600;
  padding: 4px 11px; border-radius: 999px; text-align: center; min-width: 48px;
}
.tech-sig.buy { color: var(--up); background: rgba(239, 68, 68, .12); }
.tech-sig.sell { color: var(--down); background: rgba(59, 130, 246, .12); }
.tech-sig.neutral { color: var(--sub); background: rgba(120, 120, 128, .12); }
.tech-sig.na { color: var(--sub); background: transparent; }

/* 과거 적중률 — iOS 카드 */
.tech-acc { margin-bottom: 6px; }
.tech-acc-sub { font-size: 11.5px; color: var(--sub); }
.tech-acc-sub b { color: var(--text); }
.tech-backtest-box {
  border: 1px solid var(--sep); border-radius: 16px; background: var(--card, #fff);
  padding: 12px 14px; margin-bottom: 8px;
}
.tech-backtest-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; padding-top: 8px;
}
.tech-backtest-row span { font-size: 11.5px; font-weight: 600; color: var(--sub); }
.tech-backtest-row b { font-size: 11.5px; color: var(--text); font-weight: 700; white-space: nowrap; }
@media (max-width: 390px) {
  .tech-backtest-row { align-items: flex-start; flex-direction: column; gap: 2px; }
  .tech-backtest-row b { white-space: normal; }
}

/* 면책 / placeholder */
.tech-disc {
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--sep);
  font-size: 10.5px; color: var(--sub); line-height: 1.55;
}
.tech-empty { padding: 32px 8px; text-align: center; color: var(--sub); font-size: 13px; }

/* 로딩 — Konsta iOS 프리로더(8스포크) 중앙 배치 */
.tech-loading { display: flex; align-items: center; justify-content: center; padding: 56px 0; }
.tech-loading .loading-spinner { width: 30px; height: 30px; display: inline-block; background: #ea580c !important; }
