:root {
  --sp-bg: #f4f6f9;
  --sp-surface: #ffffff;
  --sp-text: #0f172a;
  --sp-muted: #64748b;
  --sp-border: rgba(148, 163, 184, 0.28);
  --sp-gold: #c9a227;
  --sp-gold-deep: #8b6914;
  --sp-navy: #0b1f3a;
  --sp-header-bg: rgba(255, 255, 255, 0.92);
  --sp-footer-bg: #0b1220;
  --sp-hero-grad: linear-gradient(135deg, #0b1f3a 0%, #152a4a 55%, #1e3a5f 100%);
}

[data-theme="dark"] {
  --sp-bg: #0b1220;
  --sp-surface: #111827;
  --sp-text: #e2e8f0;
  --sp-muted: #94a3b8;
  --sp-border: rgba(71, 85, 105, 0.45);
  --sp-header-bg: rgba(15, 23, 42, 0.95);
  --sp-footer-bg: #020617;
  --sp-hero-grad: linear-gradient(135deg, #020617 0%, #0f172a 55%, #1e293b 100%);
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--sp-bg);
  color: var(--sp-text);
  transition: background 0.25s ease, color 0.25s ease;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

.sp-site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  backdrop-filter: blur(12px);
  background: var(--sp-header-bg);
  border-bottom: 1px solid var(--sp-border);
}

.sp-brand {
  padding: 0;
  text-decoration: none;
}

.sp-brand:hover .sp-brand-name {
  color: var(--sp-gold);
}

.sp-brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--sp-text);
  line-height: 1;
  transition: color 0.18s ease;
}

[data-theme="dark"] .sp-brand-name {
  color: #f8fafc;
}

.sp-live-pill {
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sp-muted);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--sp-border);
  background: var(--sp-surface);
}

.sp-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  animation: spPulse 2s ease-in-out infinite;
}

@keyframes spPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.btn-sp-gold {
  --bs-btn-color: #1a1204;
  --bs-btn-bg: linear-gradient(135deg, #f4d03f 0%, #c9a227 100%);
  --bs-btn-border-color: #b8860b;
  --bs-btn-hover-color: #1a1204;
  --bs-btn-hover-bg: #f4d03f;
  --bs-btn-hover-border-color: #c9a227;
  background: linear-gradient(135deg, #f4d03f 0%, #c9a227 100%);
  border: 0;
  color: #1a1204;
  font-weight: 700;
}

.btn-sp-gold:hover {
  filter: brightness(1.05);
  color: #1a1204;
}

.btn-sp-outline {
  border: 1px solid var(--sp-border);
  color: var(--sp-text);
  background: var(--sp-surface);
}

.btn-sp-outline:hover {
  border-color: var(--sp-gold);
  color: var(--sp-text);
  background: var(--sp-surface);
}

.sp-hero {
  background: var(--sp-hero-grad);
  color: #f8fafc;
  padding: 3.5rem 0 3rem;
  position: relative;
  overflow: hidden;
}

.sp-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 85% 20%, rgba(201, 162, 39, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 10% 80%, rgba(148, 163, 184, 0.12) 0%, transparent 55%);
  pointer-events: none;
}

.sp-hero .container {
  position: relative;
}

.sp-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fde68a;
  margin-bottom: 1rem;
}

.sp-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin-bottom: 1rem;
}

.sp-hero-lead {
  font-size: 1.1rem;
  color: #cbd5e1;
  max-width: 38rem;
}

.sp-ticker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 2rem;
}

@media (min-width: 768px) {
  .sp-ticker {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.sp-ticker-item {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  backdrop-filter: blur(8px);
}

.sp-ticker-metal {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 0.2rem;
}

.sp-ticker-price {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sp-ticker-change {
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 0.15rem;
}

.sp-ticker-change.is-up { color: #6ee7b7; }
.sp-ticker-change.is-down { color: #fca5a5; }
.sp-ticker-change.is-flat { color: #94a3b8; }

.sp-section {
  padding: 3.5rem 0;
}

.sp-section-alt {
  background: var(--sp-surface);
  border-top: 1px solid var(--sp-border);
  border-bottom: 1px solid var(--sp-border);
}

.sp-section-title {
  font-size: clamp(1.5rem, 2.8vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.sp-charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 992px) {
  .sp-charts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.sp-chart-slot .spotpro-metal-chart-card {
  height: 100%;
}

.sp-step {
  text-align: center;
  padding: 1.75rem 1.25rem;
  border-radius: 0.85rem;
  background: var(--sp-surface);
  border: 1px solid var(--sp-border);
  height: 100%;
}

.sp-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #f4d03f, #c9a227);
  color: #1a1204;
  font-weight: 800;
  margin-bottom: 1rem;
}

.sp-share-btn {
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--sp-border);
  color: var(--sp-text);
  background: var(--sp-surface);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.sp-share-btn:hover {
  transform: translateY(-2px);
  border-color: var(--sp-gold);
  color: var(--sp-text);
}

.sp-site-footer {
  background: var(--sp-footer-bg);
  color: #94a3b8;
  padding: 2.5rem 0;
  margin-top: auto;
}

.sp-footer-brand {
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.sp-footer-copy {
  font-size: 0.88rem;
}

.sp-site-footer a {
  color: #e2e8f0;
  text-decoration: none;
}

.sp-site-footer a:hover {
  color: #f4d03f;
}

[data-theme="dark"] .spotpro-metal-chart-embed.spotpro-metal-chart-card {
  background: #0f172a;
  border-color: rgba(71, 85, 105, 0.55);
  color: #e2e8f0;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .spotpro-metal-chart-embed .card-header,
[data-theme="dark"] .spotpro-metal-chart-embed .card-body {
  background: transparent;
}

[data-theme="dark"] .spotpro-metal-chart--gold .card-body {
  background:
    radial-gradient(ellipse 120% 80% at 50% 0%, rgba(201, 162, 39, 0.14) 0%, transparent 68%),
    linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, #0f172a 100%);
}

[data-theme="dark"] .spotpro-metal-chart--silver .card-body {
  background:
    radial-gradient(ellipse 120% 80% at 50% 0%, rgba(148, 163, 184, 0.12) 0%, transparent 68%),
    linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, #0f172a 100%);
}

[data-theme="dark"] .spotpro-metal-chart--platinum .card-body {
  background:
    radial-gradient(ellipse 120% 80% at 50% 0%, rgba(156, 163, 175, 0.12) 0%, transparent 68%),
    linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, #0f172a 100%);
}

[data-theme="dark"] .spotpro-metal-chart--palladium .card-body {
  background:
    radial-gradient(ellipse 120% 80% at 50% 0%, rgba(107, 140, 174, 0.14) 0%, transparent 68%),
    linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, #0f172a 100%);
}

[data-theme="dark"] .spotpro-metal-chart-embed .spotpro-metal-title {
  color: #e2e8f0;
}

[data-theme="dark"] .spotpro-metal-chart-embed .spotpro-metal-range-label {
  color: #94a3b8;
}

[data-theme="dark"] .spotpro-metal-stat-value,
[data-theme="dark"] .spotpro-metal-hover-price,
[data-theme="dark"] .spotpro-metal-hover-date {
  color: #e2e8f0;
}

[data-theme="dark"] .spotpro-metal-stat {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(71, 85, 105, 0.45);
}

[data-theme="dark"] .spotpro-metal-stat-label,
[data-theme="dark"] .spotpro-metal-hover-hint,
[data-theme="dark"] .spotpro-metal-hover-inspect {
  color: #94a3b8;
}

[data-theme="dark"] .spotpro-metal-hover-inspect {
  background: rgba(30, 41, 59, 0.65);
  border-color: rgba(71, 85, 105, 0.45);
}

[data-theme="dark"] .spotpro-metal-hover-inspect.is-active {
  background: rgba(30, 41, 59, 0.92);
  border-color: rgba(100, 116, 139, 0.5);
  color: #cbd5e1;
}

[data-theme="dark"] .spotpro-metal-chart--gold .spotpro-metal-hover-inspect.is-active {
  border-color: rgba(201, 162, 39, 0.35);
  background: rgba(30, 27, 15, 0.75);
}

[data-theme="dark"] .spotpro-metal-chart--silver .spotpro-metal-hover-inspect.is-active {
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.85);
}

[data-theme="dark"] .spotpro-metal-hover-chip {
  background: rgba(15, 23, 42, 0.65);
  color: #cbd5e1;
}

[data-theme="dark"] .spotpro-metal-range-group {
  background: rgba(15, 23, 42, 0.75);
  border-color: rgba(71, 85, 105, 0.45);
}

[data-theme="dark"] .spotpro-metal-range-btn {
  color: #94a3b8;
}

[data-theme="dark"] .spotpro-metal-range-btn:hover {
  color: #e2e8f0;
  background: rgba(30, 41, 59, 0.9);
}

[data-theme="dark"] .spotpro-metal-range-btn.active {
  color: #f8fafc;
  background: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .spotpro-metal-hero-change {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(71, 85, 105, 0.45);
}

[data-theme="dark"] .spotpro-metal-hero-change.is-up {
  background: rgba(6, 78, 59, 0.45);
  border-color: rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

[data-theme="dark"] .spotpro-metal-hero-change.is-down {
  background: rgba(127, 29, 29, 0.4);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

[data-theme="dark"] .spotpro-metal-hero-change.is-flat {
  color: #94a3b8;
}

[data-theme="dark"] .spotpro-metal-chart-embed .spotpro-metal-refresh {
  background: #1e293b;
  border-color: rgba(71, 85, 105, 0.6);
  color: #cbd5e1;
}

[data-theme="dark"] .spotpro-metal-crosshair-tag,
[data-theme="dark"] .spotpro-metal-crosshair-float {
  background: rgba(15, 23, 42, 0.96);
  border-color: rgba(71, 85, 105, 0.55);
  color: #e2e8f0;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .spotpro-metal-crosshair-float-price {
  color: #f8fafc;
}

[data-theme="dark"] .spotpro-metal-crosshair-float-date,
[data-theme="dark"] .spotpro-metal-crosshair-float-row,
[data-theme="dark"] .spotpro-metal-crosshair-float-sub {
  color: #94a3b8;
}

[data-theme="dark"] .spotpro-metal-crosshair-float-row strong {
  color: #e2e8f0;
}

[data-theme="dark"] .spotpro-metal-chart-wrap.is-loading::after {
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.08), rgba(255,255,255,0));
}

[data-theme="dark"] .apexcharts-toolbar svg {
  fill: #94a3b8;
}

[data-theme="dark"] .apexcharts-menu {
  background: #1e293b;
  border-color: rgba(71, 85, 105, 0.55);
  color: #e2e8f0;
}

[data-theme="dark"] .apexcharts-menu-item:hover {
  background: #334155;
}

/* Page copy — Bootstrap utilities don't follow our theme vars */
[data-theme="dark"] .text-muted {
  --bs-text-opacity: 1;
  color: var(--sp-muted) !important;
}

[data-theme="dark"] main h1,
[data-theme="dark"] main h2,
[data-theme="dark"] main h3,
[data-theme="dark"] main h4,
[data-theme="dark"] main h5,
[data-theme="dark"] main h6,
[data-theme="dark"] .sp-section-title,
[data-theme="dark"] .fw-bold {
  color: var(--sp-text);
}

[data-theme="dark"] .sp-step h3 {
  color: var(--sp-text);
}

[data-theme="dark"] main a:not(.btn):not(.sp-brand):not(.sp-share-btn) {
  color: #7dd3fc;
}

[data-theme="dark"] main a:not(.btn):not(.sp-brand):not(.sp-share-btn):hover {
  color: #bae6fd;
}

[data-theme="dark"] .btn-sp-outline {
  color: var(--sp-text);
  border-color: var(--sp-border);
  background: var(--sp-surface);
}