/* StatsPoint feed — design tokens + reel card styles.
   Drop into your Dash project's assets/ folder (auto-loaded). */

/* --sp-bg / --sp-surface / --sp-border / --sp-text / --sp-accent moved to
   assets/00_tokens.css (single token source, 2026-09-13). */
:root {
  --sp-card: var(--sp-chrome);
  --sp-surface-2: var(--sp-chip);
  --sp-text-dim: var(--sp-text-3);
  --sp-text-dim-2: var(--sp-text-2);
  --sp-verified: var(--sp-accent);
  --sp-like: #e5484d;
  --sp-font: 'Space Grotesk', sans-serif;
  --sp-mono: 'JetBrains Mono', monospace;
}

body { background: var(--sp-bg); color: var(--sp-text); font-family: var(--sp-font); margin: 0; }

/* ============ Reel card ============ */
.sp-reel {
  position: relative;
  width: min(394px, 100%);
  aspect-ratio: 9 / 16;
  border-radius: 20px;
  overflow: hidden;
  background: var(--sp-card);
  scroll-snap-align: start;
  flex: none;
}
.sp-reel__graph { position: absolute; inset: 0; }   /* your dcc.Graph wrapper — graph unchanged */

/* Bottom scrim: author + title (always visible) */
.sp-reel__bottom {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 52px 16px 14px;
  background: linear-gradient(0deg, rgba(8,8,10,.94) 0%, rgba(8,8,10,.7) 55%, transparent 100%);
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.sp-reel__bottom > * { pointer-events: auto; }

.sp-reel__author { display: flex; align-items: center; gap: 10px; padding-right: 44px; }
.sp-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--sp-surface-2); border: 1px solid #3a3a41;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--sp-accent);
}
.sp-reel__name { font-size: 13px; font-weight: 600; }
.sp-reel__name .verified { color: var(--sp-verified); font-size: 11px; }
.sp-reel__meta {
  font-family: var(--sp-mono); font-size: 9px; letter-spacing: .1em;
  color: var(--sp-text-dim-2); text-transform: uppercase;
}
.sp-reel__title {
  margin: 0; padding-right: 44px;
  font-size: 18px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25;
  text-wrap: pretty; text-shadow: 0 1px 8px rgba(0,0,0,.6);
}

/* Explore / Back button (author row, right side) */
.sp-btn-explore {
  margin-left: auto; display: flex; align-items: center; gap: 6px;
  border: 1px solid rgba(255,255,255,.18); background: rgba(20,20,23,.6);
  color: var(--sp-text); border-radius: 99px; padding: 7px 14px;
  cursor: pointer; font-family: var(--sp-font); font-size: 12px; font-weight: 600;
  min-height: 34px; backdrop-filter: blur(6px);
}

/* Right action rail */
.sp-reel__rail {
  position: absolute; right: 8px; bottom: 186px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.sp-rail-btn {
  border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 8px; min-width: 44px; min-height: 44px;
  color: var(--sp-text); font-size: 20px; text-shadow: 0 1px 6px rgba(0,0,0,.7);
}
.sp-rail-btn .count { font-family: var(--sp-mono); font-size: 10px; color: var(--sp-text); }
.sp-rail-btn.liked { color: var(--sp-like); }

/* Playback pill — hidden by default, shown in explore mode */
.sp-reel__playback {
  position: absolute; left: 14px; right: 14px; bottom: 118px;
  background: rgba(18,18,22,.88); border: 1px solid #2e2e34; border-radius: 16px;
  backdrop-filter: blur(10px); box-shadow: 0 8px 28px rgba(0,0,0,.5);
  display: none; align-items: center; gap: 12px; padding: 12px 14px;
}
.sp-reel.is-exploring .sp-reel__playback { display: flex; }

.sp-btn-play {
  width: 42px; height: 42px; flex: none; border-radius: 50%; border: 0;
  background: var(--sp-accent); color: var(--sp-bg); font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.sp-playback__body { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.sp-playback__labels {
  display: flex; justify-content: space-between;
  font-family: var(--sp-mono); font-size: 10px; color: var(--sp-text-dim-2);
}
.sp-playback__labels b { color: var(--sp-text); font-weight: 700; }
.sp-playback__labels .pct { color: var(--sp-accent); }
.sp-reel__playback input[type=range] { width: 100%; accent-color: var(--sp-accent); height: 20px; margin: 0; cursor: pointer; }
.sp-btn-settings {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  border: 1px solid #3a3a41; background: var(--sp-surface-2);
  color: #c9c6bf; font-size: 14px; cursor: pointer;
}

/* ============ Feed chrome ============ */
.sp-feed {
  display: flex; flex-direction: column; gap: 12px;
  padding: 0 18px 12px; overflow-y: auto; scroll-snap-type: y mandatory;
}
.sp-tabs { display: flex; align-items: center; gap: 4px; padding: 0 18px 8px; }
.sp-tab {
  border: 0; background: none; cursor: pointer; padding: 8px 10px; min-height: 38px;
  font-family: var(--sp-font); font-size: 14px; font-weight: 600;
  color: var(--sp-text-dim); border-bottom: 2px solid transparent;
}
.sp-tab.active { color: var(--sp-text); border-bottom-color: var(--sp-accent); }
.sp-chips { display: flex; gap: 8px; padding: 0 18px 12px; overflow-x: auto; scrollbar-width: none; }
.sp-chip {
  flex: none; border: 1px solid var(--sp-border); background: var(--sp-surface);
  color: #c9c6bf; border-radius: 99px; padding: 8px 14px; min-height: 36px;
  cursor: pointer; font-family: var(--sp-mono); font-size: 11px; font-weight: 500;
}
.sp-chip.active { border-color: var(--sp-accent); background: var(--sp-accent); color: var(--sp-bg); }
