.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.12);
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 700;
}
.rank-badge.top { background: rgba(22, 163, 74, 0.12); color: var(--success); }
#etf-peers-table tr.is-base { background: rgba(37, 99, 235, 0.06); font-weight: 700; }
.zone-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
}
.zone-badge.safe { background: rgba(22, 163, 74, 0.12); color: var(--success); }
.zone-badge.grey { background: rgba(217, 119, 6, 0.12); color: var(--warning); }
.zone-badge.danger { background: rgba(220, 38, 38, 0.12); color: var(--danger); }
.zone-badge.unknown { background: rgba(100, 116, 139, 0.12); color: #64748b; }
.zscore-guide-lead { margin: 0 0 16px; font-size: 0.95rem; }
.zscore-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 0 20px;
}
.zscore-guide-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 14px;
  border: 1px solid #e5e9f0;
  border-radius: 10px;
}
.zscore-guide-item .zone-badge { font-size: 0.8rem; padding: 6px 10px; text-align: center; line-height: 1.3; }
.zscore-guide-item strong { font-size: 0.9rem; }
.zscore-guide-item span:last-child { font-size: 0.75rem; color: #64748b; }
@media (max-width: 640px) {
  .zscore-guide-grid { grid-template-columns: 1fr; }
}
#scenario-result .sim-stat-value { white-space: normal; }
#scenario-result .sim-stat-value .zone-badge { font-size: 0.85rem; }

/* ---------- ETF vs ETF 수익률분석 ---------- */
:root {
  --etf-cmp-1: #2a78d6;
  --etf-cmp-2: #1baf7a;
  --etf-cmp-3: #eda100;
  --etf-cmp-4: #008300;
}
.etf-compare-fields { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.etf-compare-field { position: relative; width: 220px; }
.etf-compare-remove-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
}
.etf-compare-remove-btn:hover { color: var(--danger); border-color: var(--danger); }
.etf-compare-add-row { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.etf-compare-add-btn {
  padding: 9px 16px;
  border-radius: 10px;
  border: 1.5px dashed var(--accent);
  background: transparent;
  color: var(--accent-dark);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
.etf-compare-add-btn:hover { background: var(--accent-soft); }
.etf-compare-add-btn[disabled] { display: none; }
.etf-compare-add-hint { font-size: 0.78rem; color: var(--muted); }
.etf-compare-up { color: var(--success); font-weight: 700; }
.etf-compare-down { color: var(--danger); font-weight: 700; }
.etf-compare-series-name { display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; }
.etf-compare-swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; display: inline-block; }
.etf-compare-legend { display: flex; gap: 20px; flex-wrap: wrap; margin: 4px 0 12px; font-size: 0.82rem; }
.etf-compare-legend-item { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.etf-compare-chart-shell { position: relative; }
.etf-compare-chart-shell svg { width: 100%; height: auto; display: block; }
.etf-compare-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-strong);
  padding: 8px 10px;
  font-size: 0.78rem;
  min-width: 150px;
  opacity: 0;
  transition: opacity 0.1s ease;
  z-index: 5;
}
.etf-compare-tooltip.visible { opacity: 1; }
.etf-compare-tooltip .tt-date { font-weight: 700; margin-bottom: 4px; color: var(--muted); }
.etf-compare-tooltip .tt-row { display: flex; justify-content: space-between; gap: 10px; }
.etf-compare-tooltip .tt-row + .tt-row { margin-top: 2px; }
#etf-compare-monthly-table { margin-top: 18px; }
#etf-compare-monthly-table td, #etf-compare-monthly-table th { text-align: right; }
#etf-compare-monthly-table td:first-child, #etf-compare-monthly-table th:first-child { text-align: center; }
