/* Dark Financial Asset Card – Google Finance style – responsive */
.sp500-card {
  --bg: #1f2125;
  --bg-soft: #252a30;
  --bg-chip: #2b3139;
  --bg-chip-active: #3a414e;
  --border: #2e3440;
  --text: #f8f9fa;
  --muted: #8a8d91;
  --muted-2: #a8adb3;
  --green: #26a69a;
  --green-bg: rgba(38,166,154,0.12);
  --green-fill: rgba(38,166,154,0.18);
  --red: #ef5350;
  --red-bg: rgba(239,83,80,0.12);
  --up: #7dd3c0;
  --radius: 16px;
  background: var(--bg);
  background: linear-gradient(180deg, #242830 0%, #1c1f24 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}
/* Header */
.sp500-card__header {
  padding: 16px 20px 0 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.sp500-card__title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.sp500-card__subtitle {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.sp500-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.sp500-card__follow {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.18);
  background: transparent;
  color: #e6e8eb;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .18s ease;
}
.sp500-card__follow:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.28); }
.sp500-card__follow.is-following { background: #e8eaed; color: #1f2125; border-color: #e8eaed; }
.sp500-card__menu {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted-2);
  display: grid; place-items: center;
  cursor: pointer;
}
.sp500-card__menu:hover { background: rgba(255,255,255,0.06); color: var(--text); }

/* Asset selector – multiple coins */
.sp500-card__assets {
  display: flex;
  gap: 6px;
  padding: 10px 16px 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sp500-card__assets::-webkit-scrollbar { display: none; }
.sp500-card__asset {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: #23272f;
  color: #c9ced6;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all .18s ease;
}
.sp500-card__asset:hover { border-color: rgba(255,255,255,0.22); color: #fff; }
.sp500-card__asset.is-active { background: #ffffff; color: #1f2125; border-color: #ffffff; box-shadow: 0 2px 10px rgba(0,0,0,0.2); }
.sp500-card__asset img { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; background: #fff; }
.sp500-card__asset-dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85;
}

/* Price block */
.sp500-card__price-row {
  padding: 14px 20px 0 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}
.sp500-card__price {
  font-size: clamp(26px, 5vw, 32px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.sp500-card__delta {
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.sp500-card__delta.is-up { color: #81e6b0; color: #7ee0b3; }
.sp500-card__delta.is-down { color: #ff8a7a; }
.sp500-card__today { font-weight: 500; opacity: 0.95; }
.sp500-card__meta {
  padding: 4px 20px 0 20px;
  font-size: 12px;
  color: var(--muted);
}
.sp500-card__meta a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.sp500-card__meta a:hover { color: var(--text); }

/* Tabs */
.sp500-card__tabs {
  display: flex;
  gap: 6px;
  padding: 14px 16px 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sp500-card__tabs::-webkit-scrollbar { display: none; }
.sp500-card__tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .18s ease;
}
.sp500-card__tab:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.sp500-card__tab.is-active { background: var(--bg-chip-active); color: var(--text); }
.sp500-card__tab--more { display: inline-flex; align-items: center; gap: 4px; }

/* Chart */
.sp500-card__chart-wrap {
  position: relative;
  height: 220px;
  margin: 0 8px 0 4px;
}
@media (min-width: 480px) { .sp500-card__chart-wrap { height: 250px; } }
.sp500-card__chart { width: 100%; height: 100%; }
.sp500-card__prev-label {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  line-height: 1.2;
  pointer-events: none;
  background: rgba(31,33,37,0.85);
  padding: 2px 4px;
  border-radius: 4px;
}

/* Metrics */
.sp500-card__metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 8px;
  padding: 14px 20px 16px 20px;
  font-size: 13px;
  line-height: 1.8;
}
.sp500-card__metric { display: flex; justify-content: space-between; gap: 12px; }
.sp500-card__metric dt { color: var(--muted); font-weight: 500; }
.sp500-card__metric dd { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.sp500-card__col { display: flex; flex-direction: column; gap: 2px; }
.sp500-card__col + .sp500-card__col { border-left: 1px solid rgba(255,255,255,0.06); padding-left: 16px; margin-left: 8px; }
@media (max-width: 380px) {
  .sp500-card__metrics { grid-template-columns: 1fr; gap: 8px; }
  .sp500-card__col + .sp500-card__col { border-left: none; padding-left: 0; margin-left: 0; border-top: 1px solid rgba(255,255,255,0.06); padding-top: 8px; }
}
