/* ===================================================================
   WSTGRAM — Editorial Red/Black — scoped under .nd-scope
   Used by: screen-profile, screen-rating, screen-music
   Other screens (feed, chat, compose, etc.) are untouched.
   =================================================================== */

/* Global keyframes for premium effects */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.nd-scope {
  --bg: #08080a;
  --bg-deep: #000;
  --surface: #0f0f12;
  --surface-hi: #16161a;
  --border: rgba(255,255,255,0.06);
  --border-hi: rgba(255,255,255,0.12);
  --text: #f5f3ee;
  --text-muted: #6e6c70;
  --text-dim: #38363a;
  --accent: #DC2626;
  --accent-glow: #EF4444;
  --accent-deep: #B91C1C;

  position: relative;
  min-height: 100%;
  background:
    radial-gradient(ellipse at 50% -10%, color-mix(in oklab, var(--accent) 14%, transparent) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 110%, color-mix(in oklab, var(--accent-deep) 22%, transparent) 0%, transparent 45%),
    var(--bg);
  color: var(--text);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
  overflow-x: hidden;
}

/* Grain overlay */
.nd-scope .nd-grain {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/></svg>");
  mix-blend-mode: overlay;
  z-index: 1;
}

.nd-scope .nd-content {
  position: relative;
  z-index: 2;
}

/* Spin / pulse / drift keyframes */
@keyframes nd-spin { to { transform: rotate(360deg); } }
@keyframes nd-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
@keyframes nd-drift {
  0% { transform: translate(0,0) scale(1); }
  100% { transform: translate(40px, 20px) scale(1.2); }
}
@keyframes nd-marquee {
  0% { transform: translateX(0); }
  50% { transform: translateX(calc(-100% + 200px)); }
  100% { transform: translateX(0); }
}
@keyframes nd-bar-grow { from { width: 0 !important; } }
@keyframes nd-pod-rise {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes nd-fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============== TOP BAR (header line) ============== */
.nd-scope .nd-topbar-left {
  display: flex; align-items: baseline; gap: 10px;
}
.nd-scope .nd-topbar-title {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.16em;
  color: var(--text);
  text-transform: uppercase;
}
.nd-scope .nd-topbar-ver {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 500;
}
.nd-scope .nd-topbar-actions {
  display: flex; align-items: center; gap: 6px;
}
.nd-scope .nd-icon-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid var(--border-hi);
  border-radius: 10px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.nd-scope .nd-icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.nd-scope .nd-icon-btn.is-back {
  background: rgba(15,15,18,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Floating back chip — sits in the upper-left corner overlaid on the hero */
.nd-scope .nd-back-float {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 14px);
  left: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in oklab, var(--bg) 60%, transparent);
  border: 1px solid color-mix(in oklab, var(--text) 14%, transparent);
  color: var(--text);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  z-index: 10;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
  box-shadow: 0 4px 18px -4px rgba(0,0,0,0.35);
}
.nd-scope .nd-back-float:hover {
  background: color-mix(in oklab, var(--accent) 18%, var(--bg));
  border-color: color-mix(in oklab, var(--accent) 60%, transparent);
  color: var(--accent);
  transform: translateX(-2px);
}
.nd-scope .nd-back-float:active { transform: translateX(-2px) scale(0.95); }

/* When using floating back, hero needs extra top room so the avatar doesn't collide */
.nd-scope .hero.with-back { padding-top: calc(env(safe-area-inset-top) + 68px); }

/* ============== HERO (profile top) ============== */
.nd-scope .hero {
  position: relative;
  padding: 36px 22px 28px;
  text-align: center;
  overflow: hidden;
}
.nd-scope .hero-bg {
  position: absolute; inset: -10% -10% 0 -10%;
  background:
    radial-gradient(ellipse 50% 50% at 50% 0%, color-mix(in oklab, var(--accent) 22%, transparent), transparent 70%);
  pointer-events: none;
}
.nd-scope .avatar-wrap {
  position: relative;
  width: 132px; height: 132px;
  margin: 0 auto 22px;
}
.nd-scope .halo {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent-glow), var(--accent), var(--accent-deep), var(--accent), var(--accent-glow));
  filter: blur(14px);
  opacity: 0.55;
  animation: nd-spin 8s linear infinite;
}
.nd-scope .halo.halo-2 {
  inset: -22px;
  filter: blur(28px);
  opacity: 0.35;
  animation-duration: 14s;
  animation-direction: reverse;
}
.nd-scope .avatar-ring {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 50%;
  padding: 2px;
  background: conic-gradient(from 0deg, var(--accent-glow), var(--accent), #fff, var(--accent), var(--accent-glow));
  animation: nd-spin 12s linear infinite;
}
.nd-scope .avatar-ring-inner {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 50%;
  background: var(--bg);
  padding: 4px;
  animation: nd-spin 12s linear infinite reverse;
}
.nd-scope .avatar-img {
  width: 100%; height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: #1a1418;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Instrument Serif', serif;
  color: var(--text);
  font-size: 56px;
  font-style: italic;
}
.nd-scope .avatar-img img {
  width: 100%; height: 100%; object-fit: cover;
}
.nd-scope .avatar-online {
  position: absolute;
  right: 6px; bottom: 6px;
  width: 16px; height: 16px;
  background: var(--accent);
  border: 3px solid var(--bg);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--accent), 0 0 12px var(--accent);
  animation: nd-pulse 2s ease-in-out infinite;
  z-index: 3;
}
.nd-scope .display-name {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: 56px;
  line-height: 0.92;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
  color: var(--text);
  word-break: break-word;
}
.nd-scope .display-hash {
  font-style: italic;
  color: var(--accent);
  margin-left: 4px;
}
.nd-scope .hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-transform: uppercase;
  flex-wrap: wrap;
  justify-content: center;
}
.nd-scope .meta-bullet {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent);
  animation: nd-pulse 2s ease-in-out infinite;
}
.nd-scope .meta-tag {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.16em;
}
.nd-scope .meta-divider {
  width: 1px; height: 10px;
  background: var(--border-hi);
}

/* ============== MUSIC CARD ============== */
.nd-scope .music-card {
  position: relative;
  margin: 8px 16px 22px;
  padding: 20px 18px 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, color-mix(in oklab, var(--accent-deep) 25%, #0d0a0c) 0%, #0d0a0c 60%);
  border: 1px solid color-mix(in oklab, var(--accent) 20%, var(--border));
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 20px 50px -20px rgba(0,0,0,0.6),
    0 0 80px -30px color-mix(in oklab, var(--accent) 60%, transparent);
}
.nd-scope .music-aura {
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 60%);
  opacity: 0.20;
  filter: blur(40px);
  top: -50px; left: -50px;
  animation: nd-drift 8s ease-in-out infinite alternate;
  pointer-events: none;
}
.nd-scope .music-aura.music-aura-2 {
  top: auto; bottom: -80px; left: auto; right: -50px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
  opacity: 0.14;
  animation-delay: -3s;
  animation-duration: 12s;
}
.nd-scope .music-content {
  position: relative;
  display: flex;
  gap: 16px;
  align-items: center;
}
.nd-scope .vinyl-wrap { position: relative; width: 88px; height: 88px; flex-shrink: 0; }
.nd-scope .vinyl {
  width: 100%; height: 100%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #1a1418 30%, #0a0708 31%, #1a1418 40%),
    repeating-radial-gradient(circle, rgba(255,255,255,0.04) 0px, rgba(255,255,255,0.04) 1px, transparent 1px, transparent 3px);
  background-color: #0a0708;
  display: grid; place-items: center;
  box-shadow:
    inset 0 0 20px rgba(0,0,0,0.8),
    0 8px 24px -6px rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,255,255,0.04);
}
.nd-scope .vinyl.spin { animation: nd-spin 4s linear infinite; }
.nd-scope .vinyl-grooves {
  position: absolute; inset: 8px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0, transparent 2px, rgba(255,255,255,0.03) 2px, rgba(255,255,255,0.03) 3px);
}
.nd-scope .vinyl-label {
  width: 38px; height: 38px;
  border-radius: 50%;
  overflow: hidden;
  position: relative; z-index: 2;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4);
}
.nd-scope .play-btn {
  position: absolute;
  right: -6px; bottom: -6px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #0d0a0c;
  color: white;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 14px -2px color-mix(in oklab, var(--accent) 60%, transparent);
  transition: transform .15s ease;
  z-index: 3;
}
.nd-scope .play-btn:hover { transform: scale(1.08); }
.nd-scope .music-meta { flex: 1; min-width: 0; }
.nd-scope .music-label {
  display: flex; align-items: center; gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.nd-scope .music-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
  animation: nd-pulse 1.4s ease-in-out infinite;
}
.nd-scope .music-title {
  font-family: 'Instrument Serif', serif;
  font-size: 22px;
  line-height: 1.1;
  color: var(--text);
  overflow: hidden;
  white-space: nowrap;
  margin-bottom: 2px;
  mask-image: linear-gradient(90deg, transparent 0, black 5%, black 95%, transparent 100%);
}
.nd-scope .music-title-track { display: inline-block; }
.nd-scope .music-title-track.marquee {
  animation: nd-marquee 14s linear infinite;
  padding-right: 40px;
}
.nd-scope .music-artist {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ----- SEEKABLE WAVEFORM ----- */
.nd-scope .waveform {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 22px;
  margin-bottom: 6px;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.nd-scope .waveform .wave-bar {
  flex: 1;
  background: var(--text-dim);
  border-radius: 1px;
  transition: height .12s ease-out, background .12s ease;
  min-height: 2px;
  pointer-events: none;
}
.nd-scope .waveform .wave-bar.active {
  background: var(--accent);
  box-shadow: 0 0 4px color-mix(in oklab, var(--accent) 60%, transparent);
}
.nd-scope .waveform .wave-scrub-hint {
  position: absolute;
  top: -22px;
  transform: translateX(-50%);
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s ease;
}
.nd-scope .waveform.scrubbing .wave-scrub-hint { opacity: 1; }

.nd-scope .music-time {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.nd-scope .music-time .time-dim { color: var(--text-dim); }

.nd-scope .music-footer {
  position: relative;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-hi);
}
.nd-scope .playlists-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-transform: uppercase;
}
.nd-scope .playlists-chip.chip-arrow {
  margin-left: auto; color: var(--text); cursor: pointer;
  background: transparent;
}
.nd-scope .playlists-chip.chip-arrow:hover { border-color: var(--accent); color: var(--accent); }

/* ============== STATS STRIP ============== */
.nd-scope .stats-strip {
  position: relative;
  margin: 0 0 24px;
  padding: 0 22px;
}
.nd-scope .stats-rule {
  height: 1px;
  background: var(--text);
  opacity: 0.9;
}
.nd-scope .stats-rule.top { background: linear-gradient(90deg, transparent, var(--text) 5%, var(--text) 95%, transparent); }
.nd-scope .stats-rule.bot { background: linear-gradient(90deg, transparent, var(--accent) 5%, var(--accent) 95%, transparent); height: 1px; }
.nd-scope .stats-inner {
  display: grid;
  grid-template-columns: 1fr 1px 1fr 1px 1fr;
  align-items: stretch;
  padding: 18px 0 20px;
}
.nd-scope .stat-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 0 4px;
}
.nd-scope .stat-divider {
  width: 1px;
  background: var(--border-hi);
  margin: 8px 0;
}
.nd-scope .stat-label-top {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
}
.nd-scope .stat-num {
  font-family: 'Instrument Serif', serif;
  font-size: 42px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text);
}
.nd-scope .stat-num-red { color: var(--accent); font-style: italic; }
.nd-scope .stat-label-bot {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  letter-spacing: 0.10em;
  color: var(--text-dim);
  text-transform: lowercase;
}
.nd-scope .stat-col-hi .stat-label-top { color: var(--accent); }

/* ============== SECTION HEAD ============== */
.nd-scope .section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 22px;
  margin-bottom: 14px;
}
.nd-scope .section-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.nd-scope .section-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.20em;
  color: var(--text);
  text-transform: uppercase;
}
.nd-scope .section-rule {
  flex: 1;
  height: 1px;
  background: var(--border-hi);
}

/* ============== ACTIVITY TABS ============== */
.nd-scope .activity { padding-top: 8px; }
.nd-scope .tabs {
  display: flex;
  margin: 0 22px 8px;
  border-bottom: 1px solid var(--border);
}
.nd-scope .tab {
  position: relative;
  background: transparent;
  border: none;
  padding: 12px 0;
  margin-right: 22px;
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
  transition: color .15s ease;
  text-transform: uppercase;
}
.nd-scope .tab:hover { color: var(--text); }
.nd-scope .tab.active { color: var(--text); }
.nd-scope .tab.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.nd-scope .tab-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0;
  color: var(--text-dim);
  font-weight: 500;
}
.nd-scope .tab.active .tab-count { color: var(--accent); }

/* ============== POSTS LIST ============== */
.nd-scope .posts-list {
  padding: 0 22px;
  display: flex;
  flex-direction: column;
}
.nd-scope .post-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  animation: nd-fade-up .4s ease-out backwards;
  transition: padding-left .2s ease, background .2s ease;
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
  text-align: left;
  width: 100%;
  color: inherit;
}
.nd-scope .post-row:last-child { border-bottom: none; }
.nd-scope .post-row:hover { padding-left: 6px; }
.nd-scope .post-idx {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  align-self: start;
  margin-top: 2px;
}
.nd-scope .post-idx.accent { color: var(--accent); font-size: 16px; line-height: 1; }
.nd-scope .post-body { min-width: 0; }
.nd-scope .post-text {
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nd-scope .post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.10em;
  flex-wrap: wrap;
  text-transform: uppercase;
}
.nd-scope .meta-bullet-sm {
  width: 2px; height: 2px;
  background: var(--text-dim);
  border-radius: 50%;
}
.nd-scope .meta-glyph {
  color: var(--accent);
  margin-right: 3px;
  font-size: 10px;
}
.nd-scope .post-points {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 2px 0 2px 8px;
}
.nd-scope .post-points.pos { color: var(--accent); }
.nd-scope .post-points.zero { color: var(--text-dim); }
.nd-scope .post-points.big { font-size: 18px; padding: 0; align-self: center; }
.nd-scope .post-media {
  width: 44px; height: 44px;
  border-radius: 8px;
  overflow: hidden;
  display: grid; place-items: center;
  flex-shrink: 0;
  background: #1a0a0a;
}
.nd-scope .post-media img,
.nd-scope .post-media video { width: 100%; height: 100%; object-fit: cover; }
.nd-scope .post-media-skull { background: #000; }

/* ============== ACCOUNT ============== */
.nd-scope .account {
  padding-top: 24px;
  padding-bottom: 8px;
}
.nd-scope .account-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s ease;
  text-align: left;
  color: inherit;
  font: inherit;
}
.nd-scope .account-row:hover { background: rgba(255,255,255,0.02); }
.nd-scope .account-row.danger:hover { background: color-mix(in oklab, var(--accent) 6%, transparent); }
.nd-scope .account-left { flex: 1; min-width: 0; }
.nd-scope .account-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}
.nd-scope .account-row.danger .account-title { color: var(--accent); font-weight: 600; }
.nd-scope .account-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nd-scope .account-chev { color: var(--text-dim); }
.nd-scope .account-row.danger .account-chev { color: var(--accent); }

/* ============== FOOTER ============== */
.nd-scope .nd-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 28px 22px 32px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  flex-wrap: wrap;
  text-transform: uppercase;
}
.nd-scope .footer-mark {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.10em;
}
.nd-scope .footer-dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}

/* ============== RATING SCREEN ============== */
.nd-scope .rating-head {
  padding: 22px 22px 18px;
}
.nd-scope .rating-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.nd-scope .rating-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
}
.nd-scope .rating-tag-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
  animation: nd-pulse 1.6s ease-in-out infinite;
}
.nd-scope .rating-filter {
  width: 32px; height: 32px;
  background: transparent;
  border: 1px solid var(--border-hi);
  border-radius: 10px;
  display: grid; place-items: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s ease;
}
.nd-scope .rating-filter:hover { color: var(--accent); border-color: var(--accent); }
.nd-scope .rating-title {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: 52px;
  line-height: 0.92;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
  color: var(--text);
}
.nd-scope .rating-title-em {
  font-style: italic;
  color: var(--accent);
}
.nd-scope .rating-sub {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-transform: uppercase;
  flex-wrap: wrap;
}
.nd-scope .rating-sub-num {
  font-family: 'Instrument Serif', serif;
  font-size: 18px;
  color: var(--text);
  margin-right: 2px;
}
.nd-scope .rating-sub-sep { color: var(--accent); }

/* Period selector */
.nd-scope .period {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 4px 0 0;
}
.nd-scope .period-btn {
  position: relative;
  background: transparent;
  border: none;
  padding: 14px 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .15s ease;
  border-right: 1px solid var(--border);
  text-transform: uppercase;
}
.nd-scope .period-btn:last-child { border-right: none; }
.nd-scope .period-btn:hover { color: var(--text); }
.nd-scope .period-btn.active {
  color: var(--accent);
  background: color-mix(in oklab, var(--accent) 4%, transparent);
}
.nd-scope .period-btn.active::after {
  content: '';
  position: absolute;
  left: 12px; right: 12px; bottom: -1px;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

/* Podium */
.nd-scope .podium {
  position: relative;
  padding: 36px 16px 24px;
  overflow: hidden;
}
.nd-scope .podium-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 4px;
  align-items: end;
  z-index: 2;
}
.nd-scope .pod-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 0 4px 14px;
  animation: nd-pod-rise .7s cubic-bezier(.2,.7,.2,1) backwards;
  cursor: pointer;
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
}
.nd-scope .pod-left { animation-delay: 200ms; }
.nd-scope .pod-center { animation-delay: 50ms; padding-bottom: 18px; }
.nd-scope .pod-right { animation-delay: 350ms; }

.nd-scope .pod-rank-num {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  letter-spacing: -0.04em;
  margin-bottom: 2px;
}
.nd-scope .pod-primary .pod-rank-num {
  color: var(--accent);
  font-size: 30px;
  text-shadow: 0 0 16px color-mix(in oklab, var(--accent) 60%, transparent);
}

.nd-scope .pod-avatar-wrap {
  position: relative;
  width: 64px; height: 64px;
  margin: 0 0 6px;
}
.nd-scope .pod-primary .pod-avatar-wrap { width: 84px; height: 84px; }

.nd-scope .pod-avatar {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border-hi);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Instrument Serif', serif;
  color: var(--text);
  font-size: 24px;
  font-style: italic;
}
.nd-scope .pod-primary .pod-avatar { font-size: 32px; }
.nd-scope .pod-avatar img { width: 100%; height: 100%; object-fit: cover; }

.nd-scope .pod-name {
  font-family: 'Instrument Serif', serif;
  font-size: 16px;
  line-height: 1.1;
  color: var(--text);
  margin-top: 2px;
  word-break: break-word;
}
.nd-scope .pod-name-lg {
  font-size: 22px;
  font-style: italic;
}
.nd-scope .pod-role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
  min-height: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}
.nd-scope .pod-bar-track {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.04);
  border-radius: 2px;
  overflow: hidden;
  margin: 2px 0 8px;
}
.nd-scope .pod-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 8px color-mix(in oklab, var(--accent) 80%, transparent);
  animation: nd-bar-grow 1.1s cubic-bezier(.2,.7,.2,1) backwards;
  transform-origin: left;
}
.nd-scope .pod-primary .pod-bar-fill {
  background: linear-gradient(90deg, var(--accent-glow), var(--accent));
}
.nd-scope .pod-pts {
  font-family: 'Instrument Serif', serif;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 2px;
}
.nd-scope .pod-pts-lg {
  font-size: 38px;
  color: var(--accent);
  font-style: italic;
  text-shadow: 0 0 20px color-mix(in oklab, var(--accent) 40%, transparent);
}
.nd-scope .pod-delta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  letter-spacing: 0.10em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.nd-scope .pod-primary .pod-delta { color: var(--accent); }

/* List header */
.nd-scope .rank-listhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px 10px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.nd-scope .rank-sort {
  cursor: pointer;
  transition: color .15s ease;
}
.nd-scope .rank-sort:hover { color: var(--text-muted); }
.nd-scope .rank-sort.active { color: var(--accent); }
.nd-scope .rank-sort-sep { margin: 0 8px; color: var(--text-dim); opacity: 0.5; }

/* Rank list rows */
.nd-scope .rank-list {
  padding: 0 22px;
}
.nd-scope .rank-row {
  display: grid;
  grid-template-columns: 28px 40px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  animation: nd-fade-up .5s ease-out backwards;
  cursor: pointer;
  transition: padding .2s ease, background .2s ease;
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
  width: 100%;
  text-align: left;
  color: inherit;
  font: inherit;
}
.nd-scope .rank-row:last-child { border-bottom: none; }
.nd-scope .rank-row:hover { padding-left: 6px; }
.nd-scope .rank-row.is-you {
  background: linear-gradient(90deg, color-mix(in oklab, var(--accent) 10%, transparent), transparent 80%);
  border-radius: 12px;
  padding: 14px 12px;
  margin: 4px -12px;
  border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
  box-shadow: 0 0 30px -10px color-mix(in oklab, var(--accent) 60%, transparent);
}
.nd-scope .rank-num {
  font-family: 'Instrument Serif', serif;
  font-size: 22px;
  line-height: 1;
  color: var(--text-dim);
  letter-spacing: -0.03em;
}
.nd-scope .rank-row.is-you .rank-num { color: var(--accent); font-style: italic; }
.nd-scope .rank-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border-hi);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Instrument Serif', serif;
  color: var(--text);
  font-size: 16px;
  font-style: italic;
}
.nd-scope .rank-avatar img { width: 100%; height: 100%; object-fit: cover; }
.nd-scope .rank-row.is-you .rank-avatar {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--accent);
}
.nd-scope .rank-body { min-width: 0; }
.nd-scope .rank-name {
  font-family: 'Instrument Serif', serif;
  font-size: 18px;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.nd-scope .you-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  letter-spacing: 0.14em;
  font-weight: 600;
  background: var(--accent);
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}
.nd-scope .rank-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  letter-spacing: 0.10em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.nd-scope .rank-handle { color: var(--text-muted); font-weight: 500; }
.nd-scope .rank-role { color: var(--text-dim); }
.nd-scope .rank-meta-sep { color: var(--text-dim); }
.nd-scope .rank-bar-thin {
  width: 100%;
  height: 1.5px;
  background: rgba(255,255,255,0.04);
  border-radius: 1px;
  overflow: hidden;
}
.nd-scope .rank-bar-fill {
  height: 100%;
  background: color-mix(in oklab, var(--accent) 60%, var(--text-dim));
  animation: nd-bar-grow 1s cubic-bezier(.2,.7,.2,1) backwards .1s;
}
.nd-scope .rank-row.is-you .rank-bar-fill { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.nd-scope .rank-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.nd-scope .rank-pts {
  font-family: 'Instrument Serif', serif;
  font-size: 22px;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.02em;
}
.nd-scope .rank-row.is-you .rank-pts { color: var(--accent); font-style: italic; }
.nd-scope .rank-delta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.nd-scope .rank-change-same { color: var(--text-dim); font-size: 10px; line-height: 1; }

/* You anchor */
.nd-scope .you-anchor {
  position: relative;
  margin: 18px 16px 24px;
  padding: 16px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, color-mix(in oklab, var(--accent-deep) 30%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
  overflow: hidden;
  box-shadow: 0 20px 40px -20px rgba(0,0,0,0.5), 0 0 50px -20px color-mix(in oklab, var(--accent) 50%, transparent);
}
.nd-scope .you-anchor-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.nd-scope .you-anchor-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
}
.nd-scope .you-anchor-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.nd-scope .you-anchor-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
}
.nd-scope .you-anchor-rank {
  font-family: 'Instrument Serif', serif;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text);
  font-style: italic;
}
.nd-scope .you-anchor-mid {
  border-left: 1px solid var(--border-hi);
  padding-left: 14px;
  min-width: 0;
}
.nd-scope .you-anchor-name {
  font-family: 'Instrument Serif', serif;
  font-size: 17px;
  color: var(--text);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nd-scope .you-anchor-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.10em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.nd-scope .you-anchor-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--accent);
  border: none;
  border-radius: 999px;
  color: white;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 4px 14px -2px color-mix(in oklab, var(--accent) 70%, transparent);
  text-transform: uppercase;
  white-space: nowrap;
}
.nd-scope .you-anchor-cta:hover { transform: translateY(-1px); box-shadow: 0 8px 24px -4px color-mix(in oklab, var(--accent) 80%, transparent); }

/* ============== MUSIC SCREEN ============== */
.nd-scope .ms-head {
  padding: calc(env(safe-area-inset-top) + 28px) 22px 18px;
  position: relative;
  text-align: center;
}
.nd-scope .ms-head .ms-back {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 22px);
  left: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-hi);
  background: rgba(15,23,42,0.5);
  color: var(--text-muted);
  display: grid; place-items: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.nd-scope .ms-head .ms-back:hover { color: var(--text); }
.nd-scope .ms-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.nd-scope .ms-title {
  font-family: 'Instrument Serif', serif;
  font-size: 48px;
  line-height: 0.92;
  letter-spacing: -0.025em;
  color: var(--text);
  margin: 0;
}
.nd-scope .ms-title-em {
  font-style: italic;
  color: var(--accent);
}
.nd-scope .ms-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 12px;
}

/* Playlist cards list */
.nd-scope .pl-section { padding: 0 22px; }
.nd-scope .pl-list { display: flex; flex-direction: column; gap: 10px; }
.nd-scope .pl-card {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, color-mix(in oklab, var(--accent-deep) 8%, var(--surface)) 0%, var(--surface) 60%);
  text-align: left;
  width: 100%;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s;
  color: inherit;
  font: inherit;
}
.nd-scope .pl-card.active {
  border-color: color-mix(in oklab, var(--accent) 50%, var(--border));
  background: linear-gradient(135deg, color-mix(in oklab, var(--accent) 12%, var(--surface)) 0%, var(--surface) 60%);
  box-shadow: 0 4px 18px -6px color-mix(in oklab, var(--accent) 40%, transparent);
}
.nd-scope .pl-cover {
  width: 64px; height: 64px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-glow) 0%, var(--accent) 50%, var(--accent-deep) 100%);
  position: relative;
  display: grid;
  place-items: center;
  color: #fff;
}
.nd-scope .pl-cover::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.18), transparent 55%);
}
.nd-scope .pl-body {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.nd-scope .pl-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nd-scope .pl-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.nd-scope .pl-actions {
  display: flex; align-items: center;
  padding: 0 10px 0 4px;
  gap: 4px;
}
.nd-scope .pl-iconbtn {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all .15s ease;
}
.nd-scope .pl-iconbtn:hover {
  background: color-mix(in oklab, var(--accent) 10%, transparent);
  color: var(--accent);
}

.nd-scope .pl-create {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px dashed color-mix(in oklab, var(--accent) 40%, var(--border));
  background: linear-gradient(135deg, color-mix(in oklab, var(--accent) 4%, transparent), transparent);
  color: inherit;
  cursor: pointer;
  transition: all .2s ease;
}
.nd-scope .pl-create:hover {
  background: color-mix(in oklab, var(--accent) 10%, transparent);
}
.nd-scope .pl-create-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--accent) 15%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 40%, transparent);
  display: grid; place-items: center;
  color: var(--accent);
}
.nd-scope .pl-create-text {
  flex: 1; text-align: left;
}
.nd-scope .pl-create-title { font-size: 14px; font-weight: 600; color: var(--text); }
.nd-scope .pl-create-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 3px;
}

.nd-scope .pl-newform {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.nd-scope .pl-input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-hi);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: 'Manrope', sans-serif;
  outline: none;
}
.nd-scope .pl-input:focus { border-color: var(--accent); }
.nd-scope .pl-row { display: flex; gap: 8px; }
.nd-scope .pl-btn-primary {
  flex: 1;
  padding: 11px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px -2px color-mix(in oklab, var(--accent) 60%, transparent);
}
.nd-scope .pl-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.nd-scope .pl-btn-secondary {
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-hi);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
}

/* Tracks list */
.nd-scope .tracks-list {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}
.nd-scope .track-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: transparent;
  transition: background 0.15s ease;
}
.nd-scope .track-row:last-child { border-bottom: none; }
.nd-scope .track-row.is-current { background: color-mix(in oklab, var(--accent) 7%, transparent); }
.nd-scope .track-playbtn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-hi);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  display: grid; place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .15s ease;
}
.nd-scope .track-playbtn:hover { background: color-mix(in oklab, var(--accent) 10%, transparent); color: var(--accent); }
.nd-scope .track-row.is-current .track-playbtn {
  background: linear-gradient(135deg, var(--accent-glow), var(--accent-deep));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px -2px color-mix(in oklab, var(--accent) 60%, transparent);
}
.nd-scope .track-info { flex: 1; min-width: 0; }
.nd-scope .track-title {
  font-size: 13.5px;
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nd-scope .track-row.is-current .track-title { color: var(--accent); font-weight: 600; }
.nd-scope .track-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 3px;
  display: flex; align-items: center; gap: 8px;
}

/* Floating big player */
.nd-scope .floating-player {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 8px);
  transform: translateX(-50%);
  width: min(calc(100vw - 16px), calc(var(--shell-max-w) - 16px));
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(15,15,18,0.92), rgba(8,8,10,0.96));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid color-mix(in oklab, var(--accent) 18%, var(--border-hi));
  border-radius: 16px;
  box-shadow:
    0 -8px 40px rgba(0,0,0,0.45),
    0 0 30px -10px color-mix(in oklab, var(--accent) 50%, transparent);
  z-index: 60;
  display: flex; flex-direction: column; gap: 10px;
}
.nd-scope .fp-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nd-scope .fp-disc {
  width: 44px; height: 44px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, var(--accent-deep) 30%, #0a0708 31%, var(--accent-deep) 40%),
    repeating-radial-gradient(circle, rgba(255,255,255,0.04) 0px, rgba(255,255,255,0.04) 1px, transparent 1px, transparent 3px);
  background-color: #0a0708;
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: 0 0 12px color-mix(in oklab, var(--accent) 40%, transparent);
}
.nd-scope .fp-disc.spin { animation: nd-spin 6s linear infinite; }
.nd-scope .fp-disc-label {
  width: 16px; height: 16px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-glow), var(--accent-deep));
  border: 1px solid rgba(0,0,0,0.4);
}
.nd-scope .fp-info { flex: 1; min-width: 0; }
.nd-scope .fp-title {
  font-family: 'Instrument Serif', serif;
  font-size: 16px;
  line-height: 1.2;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nd-scope .fp-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nd-scope .fp-controls { display: flex; align-items: center; gap: 6px; }
.nd-scope .fp-ctl {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color .15s ease;
}
.nd-scope .fp-ctl:hover { color: var(--text); }
.nd-scope .fp-ctl.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  box-shadow: 0 4px 14px -2px color-mix(in oklab, var(--accent) 60%, transparent);
}
.nd-scope .fp-ctl.primary:hover { color: #fff; }

/* Seek bar — generic, used in floating + can be used in card */
.nd-scope .seekbar {
  position: relative;
  height: 18px;
  display: flex; align-items: center;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.nd-scope .seekbar-track {
  position: relative;
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.10);
  border-radius: 2px;
  overflow: hidden;
}
.nd-scope .seekbar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-glow), var(--accent));
  box-shadow: 0 0 8px color-mix(in oklab, var(--accent) 70%, transparent);
}
.nd-scope .seekbar-knob {
  position: absolute;
  top: 50%;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px color-mix(in oklab, var(--accent) 60%, transparent);
  opacity: 0;
  transition: opacity .15s ease;
  pointer-events: none;
}
.nd-scope .seekbar:hover .seekbar-knob,
.nd-scope .seekbar.scrubbing .seekbar-knob { opacity: 1; }
.nd-scope .seekbar.scrubbing .seekbar-track { height: 4px; }

.nd-scope .fp-time {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.nd-scope .fp-time .dim { color: var(--text-dim); }

/* Bio + edit (profile) */
.nd-scope .bio-block {
  margin: 8px 16px 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(135deg, color-mix(in oklab, var(--accent-deep) 6%, var(--surface)), var(--surface));
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.nd-scope .bio-block::before {
  content: '';
  position: absolute;
  top: 0; right: 0; width: 80px; height: 80px;
  background: radial-gradient(circle at top right, color-mix(in oklab, var(--accent) 18%, transparent), transparent 70%);
  pointer-events: none;
}
.nd-scope .bio-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  position: relative;
}
.nd-scope .bio-head-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.20em;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}
.nd-scope .bio-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 600;
}
.nd-scope .bio-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-line;
  position: relative;
}
.nd-scope .bio-text.empty { color: var(--text-muted); font-style: italic; }
.nd-scope .bio-form { display: flex; flex-direction: column; gap: 10px; position: relative; }
.nd-scope .bio-textarea {
  resize: vertical;
  min-height: 90px;
  font-family: inherit;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-hi);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.nd-scope .bio-textarea:focus { border-color: var(--accent); }

/* Error banner */
.nd-scope .nd-error {
  margin: 0 16px 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in oklab, var(--accent) 40%, transparent);
  border-radius: 10px;
  background: color-mix(in oklab, var(--accent) 8%, transparent);
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nd-scope .nd-error button {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--accent);
  cursor: pointer;
  display: grid; place-items: center;
}

/* Empty states */
.nd-scope .nd-empty {
  padding: 24px 14px;
  text-align: center;
  border: 1px dashed var(--border-hi);
  border-radius: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-transform: uppercase;
  background: rgba(255,255,255,0.02);
}

/* Stories grid (pinned) */
.nd-scope .pinned-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 16px;
  margin-bottom: 22px;
}
.nd-scope .pinned-tile {
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-hi);
  background: #000;
  cursor: pointer;
  padding: 0;
}
.nd-scope .pinned-tile img,
.nd-scope .pinned-tile video {
  width: 100%; height: 100%; object-fit: cover;
}

/* Helper: section padding bottom for screens that need extra space */
.nd-scope .nd-pad-bottom { padding-bottom: var(--screen-pad-bottom); }
.nd-scope .nd-pad-bottom-player { padding-bottom: calc(var(--screen-pad-bottom) + 96px); }

/* ===================================================================
   LIGHT THEME — kicks in when <html data-theme="light">
   The music card stays accent/dark — it's a premium element.
   =================================================================== */
html[data-theme="light"] .nd-scope {
  --bg: #f6f3ed;
  --bg-deep: #ffffff;
  --surface: #ffffff;
  --surface-hi: #faf6ed;
  --border: rgba(20,15,10,0.08);
  --border-hi: rgba(20,15,10,0.18);
  --text: #14110d;
  --text-muted: #6e6a64;
  --text-dim: #b8b2a8;

  background:
    radial-gradient(ellipse at 50% -10%, color-mix(in oklab, var(--accent) 12%, transparent) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 110%, color-mix(in oklab, var(--accent) 8%, transparent) 0%, transparent 45%),
    var(--bg);
  color: var(--text);
}
html[data-theme="light"] .nd-scope .nd-grain {
  opacity: 0.14;
  mix-blend-mode: multiply;
}
html[data-theme="light"] .nd-scope .avatar-img { background: #faf0eb; }
html[data-theme="light"] .nd-scope .avatar-ring-inner { background: var(--bg); }
html[data-theme="light"] .nd-scope .avatar-online { border-color: var(--bg); }

/* Music card stays dark/red even on light theme — premium accent */
html[data-theme="light"] .nd-scope .music-card {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 24px 50px -20px rgba(140,30,40,0.30),
    0 0 0 1px rgba(20,15,10,0.04);
  border-color: color-mix(in oklab, var(--accent) 28%, rgba(20,15,10,0.06));
}

/* Stats rule top */
html[data-theme="light"] .nd-scope .stats-rule.top {
  background: linear-gradient(90deg, transparent, var(--text) 5%, var(--text) 95%, transparent);
}

/* Periods + tabs glow */
html[data-theme="light"] .nd-scope .tab.active::after,
html[data-theme="light"] .nd-scope .period-btn.active::after {
  box-shadow: 0 0 8px color-mix(in oklab, var(--accent) 60%, transparent);
}

/* Bars */
html[data-theme="light"] .nd-scope .pod-bar-track,
html[data-theme="light"] .nd-scope .rank-bar-thin {
  background: rgba(20,15,10,0.06);
}

/* You-row blends with light bg */
html[data-theme="light"] .nd-scope .rank-row.is-you {
  background: linear-gradient(90deg, color-mix(in oklab, var(--accent) 8%, transparent), transparent 80%);
}
html[data-theme="light"] .nd-scope .you-anchor {
  background: linear-gradient(135deg, color-mix(in oklab, var(--accent) 6%, var(--surface)), var(--surface));
  border-color: color-mix(in oklab, var(--accent) 28%, transparent);
  box-shadow: 0 20px 40px -20px rgba(140,30,40,0.20), 0 0 50px -20px color-mix(in oklab, var(--accent) 30%, transparent);
}

/* Skull/dark post backgrounds remain dark by design */
html[data-theme="light"] .nd-scope .post-media-skull { background: #14110d; }

/* Account row hover */
html[data-theme="light"] .nd-scope .account-row:hover { background: rgba(20,15,10,0.02); }
html[data-theme="light"] .nd-scope .account-row.danger:hover { background: color-mix(in oklab, var(--accent) 5%, transparent); }

/* Playlist cards a touch lighter */
html[data-theme="light"] .nd-scope .pl-card {
  background: linear-gradient(135deg, color-mix(in oklab, var(--accent) 4%, var(--surface)) 0%, var(--surface) 60%);
}
html[data-theme="light"] .nd-scope .pl-card.active {
  background: linear-gradient(135deg, color-mix(in oklab, var(--accent) 8%, var(--surface)) 0%, var(--surface) 60%);
}

/* Tracks list stays surface */
html[data-theme="light"] .nd-scope .tracks-list { background: var(--surface); }
html[data-theme="light"] .nd-scope .track-playbtn { background: rgba(20,15,10,0.04); }

/* Floating player — slight tint, still dark-ish for contrast against music vibe */
html[data-theme="light"] .nd-scope .floating-player {
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(250,246,237,0.96));
  border-color: color-mix(in oklab, var(--accent) 30%, var(--border-hi));
  box-shadow:
    0 -8px 40px rgba(140,30,40,0.18),
    0 0 30px -10px color-mix(in oklab, var(--accent) 30%, transparent);
}

/* Bio block, error, empty states */
html[data-theme="light"] .nd-scope .bio-block {
  background: linear-gradient(135deg, color-mix(in oklab, var(--accent) 4%, var(--surface)), var(--surface));
  border-color: var(--border-hi);
}
html[data-theme="light"] .nd-scope .bio-textarea,
html[data-theme="light"] .nd-scope .pl-input {
  background: #fff;
  color: var(--text);
}
html[data-theme="light"] .nd-scope .nd-empty {
  background: rgba(20,15,10,0.02);
}

/* Theme toggle button surface */
html[data-theme="light"] .nd-scope .nd-icon-btn { color: var(--text-muted); border-color: var(--border-hi); }

/* Tiny responsive */
@media (max-width: 380px) {
  .nd-scope .display-name { font-size: 44px; }
  .nd-scope .rating-title { font-size: 42px; }
  .nd-scope .ms-title { font-size: 38px; }
  .nd-scope .stat-num { font-size: 34px; }
  .nd-scope .pod-pts-lg { font-size: 32px; }
  .nd-scope .music-card { margin-left: 12px; margin-right: 12px; }
  .nd-scope .bio-block { margin-left: 12px; margin-right: 12px; }
}
