/* ============================================================
   BITTENSOR ECOSYSTEM EXPLORER — CINEMATIC DARK STYLESHEET
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Inter:wght@300;400;500;600;700&display=swap');

/* ─── CSS Variables ─────────────────────────────────────── */
:root {
  --bg-void:      #000000;
  --bg-deep:      #020408;
  --bg-navy:      #0a0e1a;
  --bg-card:      #0d1120;
  --bg-elevated:  #111827;
  --bg-hover:     #1a2035;

  --tao-cyan:     #00D4FF;
  --electric:     #1E90FF;
  --violet:       #7B68EE;
  --tao-glow:     rgba(0, 212, 255, 0.15);
  --electric-glow:rgba(30, 144, 255, 0.15);
  --violet-glow:  rgba(123, 104, 238, 0.15);

  --text-primary:   #E8F4FD;
  --text-secondary: #94A3B8;
  --text-dim:       #4A5568;
  --text-accent:    #00D4FF;

  --border-subtle:  rgba(0, 212, 255, 0.08);
  --border-glow:    rgba(0, 212, 255, 0.25);
  --border-hot:     rgba(0, 212, 255, 0.5);

  --shadow-card:  0 4px 24px rgba(0, 0, 0, 0.6), 0 1px 4px rgba(0, 212, 255, 0.05);
  --shadow-glow:  0 0 20px rgba(0, 212, 255, 0.3), 0 0 60px rgba(0, 212, 255, 0.1);
  --shadow-intense: 0 0 40px rgba(0, 212, 255, 0.5), 0 0 100px rgba(0, 212, 255, 0.2);

  --font-display: 'Orbitron', monospace;
  --font-mono:    'Space Mono', monospace;
  --font-body:    'Inter', sans-serif;

  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  20px;

  --transition-fast:   150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow:   600ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  background: var(--bg-void);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(0, 212, 255, 0.25);
  color: #fff;
}

/* ─── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { 
  background: rgba(0, 212, 255, 0.3);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(0, 212, 255, 0.6); }

/* ─── App Shell ─────────────────────────────────────────── */
#app {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* ─── Background Canvas ─────────────────────────────────── */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ─── Subtle Noise Overlay (deep space grain) ────────────── */
#app::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* ─── Vignette ──────────────────────────────────────────── */
#app::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 40%,
    rgba(0, 0, 0, 0.4) 75%,
    rgba(0, 0, 0, 0.75) 100%
  );
}

/* ─── Edge Glint — cinematic perimeter reflection ───────── */
#edge-glint {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  will-change: opacity;

  /*
   * Conic gradient creates a sharp, tapered light streak.
   * - The bright arc spans ~30° (0.08turn) with a hot white core
   *   and quick falloff to transparent on both sides.
   * - A radial mask punches out the center, leaving only a
   *   thin ~10px ring visible along the viewport perimeter.
   * - The --glint-angle custom property drives the rotation.
   */
  --glint-angle: 0deg;
  background: conic-gradient(
    from var(--glint-angle),
    transparent 0deg,
    transparent 340deg,
    rgba(180,220,255,0.02) 345deg,
    rgba(200,235,255,0.10) 349deg,
    rgba(220,245,255,0.35) 352deg,
    rgba(255,255,255,0.85) 355deg,
    rgba(255,255,255,1.0)  357deg,
    rgba(255,255,255,0.85) 359deg,
    rgba(220,245,255,0.35) 361deg,
    rgba(200,235,255,0.10) 364deg,
    rgba(180,220,255,0.02) 367deg,
    transparent 370deg,
    transparent 380deg
  );

  -webkit-mask-image:
    radial-gradient(
      ellipse at center,
      transparent 0%,
      transparent calc(100% - 12px),
      black       calc(100% - 10px),
      black       calc(100% - 2px),
      transparent 100%
    );
  mask-image:
    radial-gradient(
      ellipse at center,
      transparent 0%,
      transparent calc(100% - 12px),
      black       calc(100% - 10px),
      black       calc(100% - 2px),
      transparent 100%
    );
}

/* Active state: animate rotation + fade in/out */
#edge-glint.active {
  animation: glint-sweep 1.3s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes glint-sweep {
  0% {
    --glint-angle: 0deg;
    opacity: 0;
  }
  5% {
    opacity: 0.9;
  }
  80% {
    opacity: 0.85;
  }
  100% {
    --glint-angle: 360deg;
    opacity: 0;
  }
}

/* Register the custom property so it can be animated */
@property --glint-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

/* ============================================================
   LANDING VIEW
   ============================================================ */

#landing-view {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 2rem;
  text-align: center;
  transition: opacity var(--transition-slow), visibility var(--transition-slow);
  opacity: 1;
  visibility: visible;
}

#landing-view.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* TAO Logo — Black Hole */
.tao-logo-container {
  position: relative;
  margin-bottom: 2.5rem;
  animation: floatLogo 6s ease-in-out infinite;
  width: 200px;
  height: 200px;
}

#blackhole-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 500px;
  pointer-events: none;
  z-index: 0;
}

/* ── Black hole hover suction canvas ── */
#blackhole-suction-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 500px;
  pointer-events: none;
  z-index: 0;
}

@keyframes floatLogo {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-12px); }
}

.tao-logo {
  width: 160px;
  height: 160px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Smooth hover inflate/deflate */
  transition: transform 550ms cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform;
}

.tao-logo.bh-hover {
  transform: translate(-50%, -50%) scale(1.10);
  transition: transform 600ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

.tao-logo-fill {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.98) 40%,
    rgba(0, 5, 15, 0.95) 65%,
    rgba(0, 10, 25, 0.85) 80%,
    rgba(0, 15, 35, 0.5) 90%,
    transparent 100%
  );
  z-index: 0;
}

.tao-logo-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--tao-cyan);
  box-shadow: 
    0 0 25px var(--tao-cyan),
    0 0 50px rgba(0, 212, 255, 0.4),
    0 0 80px rgba(0, 212, 255, 0.15),
    inset 0 0 30px rgba(0, 212, 255, 0.08);
  animation: ringPulse 3s ease-in-out infinite;
  z-index: 1;
  transition: box-shadow 600ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

.tao-logo.bh-hover .tao-logo-ring {
  box-shadow: 
    0 0 30px var(--tao-cyan),
    0 0 60px rgba(0, 212, 255, 0.55),
    0 0 100px rgba(0, 212, 255, 0.22),
    inset 0 0 40px rgba(0, 212, 255, 0.12);
}

.tao-logo-ring-2 {
  position: absolute;
  width: 125%;
  height: 125%;
  top: -12.5%;
  left: -12.5%;
  border-radius: 50%;
  border: 1px solid rgba(0, 212, 255, 0.15);
  animation: ringPulse 3s ease-in-out infinite 0.5s;
  z-index: 1;
}

.tao-logo-ring-3 {
  position: absolute;
  width: 155%;
  height: 155%;
  top: -27.5%;
  left: -27.5%;
  border-radius: 50%;
  border: 1px solid rgba(0, 212, 255, 0.06);
  animation: ringPulse 3s ease-in-out infinite 1s;
  z-index: 1;
}

@keyframes ringPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.7; transform: scale(1.03); }
}

.tao-symbol {
  width: 38%;
  height: 38%;
  object-fit: contain;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 12px var(--tao-cyan))
         drop-shadow(0 0 30px rgba(0, 212, 255, 0.5))
         drop-shadow(0 0 55px rgba(0, 212, 255, 0.2));
  animation: symbolGlow 3s ease-in-out infinite;
}

@keyframes symbolGlow {
  0%, 100% { filter: drop-shadow(0 0 12px var(--tao-cyan)) drop-shadow(0 0 30px rgba(0, 212, 255, 0.5)) drop-shadow(0 0 55px rgba(0, 212, 255, 0.2)); }
  50%      { filter: drop-shadow(0 0 18px var(--tao-cyan)) drop-shadow(0 0 40px rgba(0, 212, 255, 0.6)) drop-shadow(0 0 70px rgba(0, 212, 255, 0.3)); }
}

/* Title */
.landing-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  font-weight: 900;
  letter-spacing: 0.15em;
  background: linear-gradient(
    135deg,
    #ffffff 0%,
    var(--tao-cyan) 40%,
    var(--electric) 70%,
    var(--violet) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
  line-height: 1;
  animation: titleReveal 1s ease-out 0.2s both;
  position: relative;
  display: inline-block;
}

/* Edge reflection canvas sits exactly over the title */
#title-edge-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

@keyframes titleReveal {
  from { opacity: 0; transform: translateY(30px); filter: blur(10px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.landing-subtitle {
  font-family: var(--font-mono);
  font-size: clamp(0.7rem, 1.5vw, 0.95rem);
  color: #ffffff;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 3rem;
  animation: titleReveal 1s ease-out 0.5s both;
}

/* Stats Row */
.landing-stats {
  display: flex;
  gap: 3rem;
  margin-bottom: 3rem;
  align-items: flex-end;  /* align all stat items by their bottom edge */
  animation: titleReveal 1s ease-out 0.7s both;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  height: 2rem;           /* fixed height so all values occupy same vertical space */
  display: flex;
  align-items: flex-end;  /* bottom-align the text within the fixed box */
  justify-content: center;
  color: var(--tao-cyan);
  text-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

/* Make ∞ symbol visually match the optical weight of 128/12 numbers */
.stat-value-infinity {
  font-size: 2.2rem;
  line-height: 1;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #ffffff;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 0.35rem;
}

/* CTA Button */
.cta-btn {
  position: relative;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bg-void);
  background: linear-gradient(135deg, var(--tao-cyan), var(--electric));
  border: none;
  border-radius: var(--radius-md);
  padding: 1rem 2.5rem;
  cursor: pointer;
  overflow: hidden;
  transition: all var(--transition-smooth);
  box-shadow: 
    0 0 20px rgba(0, 212, 255, 0.4),
    0 4px 15px rgba(0, 0, 0, 0.5);
  animation: titleReveal 1s ease-out 0.9s both;
}

.cta-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.cta-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 
    0 0 40px rgba(0, 212, 255, 0.6),
    0 0 80px rgba(0, 212, 255, 0.2),
    0 8px 25px rgba(0, 0, 0, 0.6);
}

.cta-btn:hover::before { opacity: 1; }
.cta-btn:active { transform: translateY(0) scale(0.99); }

.cta-btn-pulse {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  border: 2px solid var(--tao-cyan);
  animation: ctaPulse 2s ease-out infinite;
  pointer-events: none;
}

@keyframes ctaPulse {
  0%   { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* Version badge */
.version-badge {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  white-space: nowrap;
}

/* ============================================================
   GRAPH VIEW
   ============================================================ */

#graph-view {
  position: absolute;
  inset: 0;
  z-index: 5;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

#graph-view.active {
  opacity: 1;
  visibility: visible;
}

/* Graph SVG */
#graph-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
}

/* Graph settles hidden, then fades in */
.graph-root {
  opacity: 0;
  transition: opacity 400ms ease;
}
.graph-root.settled {
  opacity: 1;
}

#graph-svg:active { cursor: grabbing; }

/* ─── Top Bar ───────────────────────────────────────────── */
#top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.95) 0%,
    rgba(2, 4, 8, 0.85) 70%,
    transparent 100%
  );
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
}

.top-bar-logo {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--tao-cyan);
  letter-spacing: 0.15em;
  text-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
  white-space: nowrap;
  flex-shrink: 0;
}

.top-bar-logo span {
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.1em;
}

/* Search */
.search-wrapper {
  position: relative;
  flex: 1;
  max-width: 380px;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.8rem;
  pointer-events: none;
  transition: color var(--transition-fast);
}

#search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.85rem 0.55rem 2.2rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-smooth);
}

#search-input::placeholder { color: var(--text-dim); }

#search-input:focus {
  border-color: var(--border-glow);
  background: rgba(0, 212, 255, 0.04);
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.1);
}

#search-input:focus + .search-icon,
.search-wrapper:focus-within .search-icon {
  color: var(--tao-cyan);
}

.search-clear {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.25rem;
  border-radius: 50%;
  display: none;
  transition: color var(--transition-fast);
}

.search-clear:hover { color: var(--tao-cyan); }
.search-clear.visible { display: block; }

/* Filter chips — REMOVED, replaced by filter-system rows */
.filter-chips { display: none; }
.filter-chip { display: none; }
.chip-dot { display: none; }

/* Back button */
.back-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.back-btn:hover {
  color: var(--tao-cyan);
  border-color: var(--border-glow);
  background: var(--tao-glow);
}

/* Node count badge */
.node-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

.node-count strong {
  color: var(--tao-cyan);
  font-weight: 400;
}

.data-timestamp {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.25);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.05em;
}

/* Category panel removed */

/* ─── Graph Tooltip ─────────────────────────────────────── */
#tooltip {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  transform: translate(12px, -50%);
  max-width: 240px;
}

#tooltip.visible { opacity: 1; }

.tooltip-inner {
  background: rgba(5, 8, 15, 0.97);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  box-shadow: 
    var(--shadow-card),
    0 0 20px rgba(0, 212, 255, 0.15);
}

.tooltip-id {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-bottom: 0.2rem;
  letter-spacing: 0.1em;
}

.tooltip-name {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
  line-height: 1.2;
}

.tooltip-category {
  font-size: 0.68rem;
  font-weight: 500;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  display: inline-block;
  margin-bottom: 0.4rem;
  color: var(--bg-void);
}

.tooltip-desc {
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ─── Side Detail Panel ─────────────────────────────────── */
#detail-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  width: 380px;
  max-width: 100%;
  background: rgba(4, 8, 18, 0.97);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--border-subtle);
  transform: translateX(100%);
  transition: transform var(--transition-spring);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.8), -1px 0 0 rgba(0, 212, 255, 0.05);
}

#detail-panel.open {
  transform: translateX(0);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 0;
  flex-shrink: 0;
}

.panel-close {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.panel-close:hover {
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--border-glow);
  color: var(--tao-cyan);
}

.panel-subnet-header {
  flex: 1;
  margin-right: 0.75rem;
}

.panel-subnet-id {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  margin-bottom: 0.35rem;
}

.panel-subnet-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: 0.5rem;
}

.panel-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 100px;
  color: var(--bg-void);
}

/* Panel glow bar */
.panel-glow-bar {
  height: 2px;
  margin: 1rem 1.25rem;
  border-radius: 1px;
  flex-shrink: 0;
}

/* Panel Body */
.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.panel-section-title {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.panel-desc {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Metrics Grid */

/* Price Section */
.panel-price-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}

.panel-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-price-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.panel-price-usd {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.panel-price-tao {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.panel-price-change {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
  line-height: 1;
}

.panel-price-change.positive {
  color: #00FF88;
  background: rgba(0, 255, 136, 0.1);
}

.panel-price-change.negative {
  color: #FF4444;
  background: rgba(255, 68, 68, 0.1);
}

.panel-price-change.neutral {
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.metric-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.75rem;
  transition: all var(--transition-fast);
}

.metric-card:hover {
  background: rgba(0, 212, 255, 0.04);
  border-color: rgba(0, 212, 255, 0.15);
}

.metric-value {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--tao-cyan);
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.metric-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Tags */
.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.5rem;
}

/* Related subnets */
.related-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.related-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.related-chip:hover {
  color: var(--text-primary);
  background: rgba(0, 212, 255, 0.06);
  border-color: var(--border-glow);
  transform: translateY(-1px);
}

.related-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* External link */
.panel-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--tao-cyan);
  background: rgba(0, 212, 255, 0.05);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-smooth);
}

.panel-link:hover {
  background: rgba(0, 212, 255, 0.12);
  border-color: rgba(0, 212, 255, 0.4);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
  transform: translateY(-1px);
}

/* ─── Graph SVG Styles ──────────────────────────────────── */
.graph-edge {
  stroke-width: 0.7px;
  fill: none;
  stroke-opacity: 0.18;
  transition: stroke-opacity 220ms ease-in,
              stroke-width 220ms ease-in,
              filter 220ms ease-in;
}

.graph-edge.highlighted {
  stroke-opacity: 0.8;
  stroke-width: 1.5px;
  filter: drop-shadow(0 0 3px currentColor);
}

.graph-edge.dimmed {
  stroke-opacity: 0.05;
}

.node-group {
  cursor: pointer;
}

.node-circle {
  transform-origin: center;
  transform-box: fill-box;
  will-change: transform, opacity;
}

/* Outer glow ring */
.node-glow {
  transform-origin: center;
  transform-box: fill-box;
}

/* Inner dot */
.node-inner {
  transform-origin: center;
  transform-box: fill-box;
}

/* ── Hover Animation System ──────────────────────────── */
/* All animations driven by JS via inline styles for precise control.
   CSS classes used only for neighbor/dim states with smooth transitions. */

/* 1-hop neighbors: brightness boost */
.node-group.node-neighbor {
  transition: opacity 150ms cubic-bezier(0.22, 1, 0.36, 1);
}
.node-group.node-neighbor .node-circle {
  transition: transform 150ms cubic-bezier(0.22, 1, 0.36, 1);
}
.node-group.node-neighbor .node-glow {
  transition: stroke-opacity 150ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 150ms cubic-bezier(0.22, 1, 0.36, 1);
}
.node-group.node-neighbor .node-inner {
  transition: transform 150ms cubic-bezier(0.22, 1, 0.36, 1);
}
.node-group.node-neighbor .node-label {
  transition: fill 150ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* 2-hop neighbors */
.node-group.node-neighbor-2 {
  transition: opacity 200ms cubic-bezier(0.22, 1, 0.36, 1);
}
.node-group.node-neighbor-2 .node-glow {
  transition: stroke-opacity 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Non-related nodes: very subtle dim */
.node-group.node-hover-dimmed {
  opacity: 0.82;
  transition: opacity 180ms cubic-bezier(0.22, 1, 0.36, 1);
}
.node-group.node-hover-dimmed .node-label {
  opacity: 0.4;
  transition: opacity 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Edge hover states */
.graph-edge.edge-hover-bright {
  stroke-opacity: 0.55;
  stroke-width: 1.3px;
  transition: stroke-opacity 150ms cubic-bezier(0.22, 1, 0.36, 1),
              stroke-width 150ms cubic-bezier(0.22, 1, 0.36, 1);
}
.graph-edge.edge-hover-2 {
  stroke-opacity: 0.38;
  stroke-width: 1.1px;
  transition: stroke-opacity 180ms cubic-bezier(0.22, 1, 0.36, 1),
              stroke-width 180ms cubic-bezier(0.22, 1, 0.36, 1);
}
.graph-edge.edge-hover-dim {
  stroke-opacity: 0.12;
  transition: stroke-opacity 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Hover-out return transitions (applied when classes are removed) ── */
/* These use the gentler ease-in curve for the "settle back" feel */
.node-group:not(.node-hovered):not(.node-neighbor):not(.node-neighbor-2):not(.node-hover-dimmed) {
  transition: opacity 250ms cubic-bezier(0.33, 0, 0.67, 1);
}
.node-group:not(.node-hovered):not(.node-neighbor):not(.node-neighbor-2) .node-circle {
  transition: transform 250ms cubic-bezier(0.33, 0, 0.67, 1),
              stroke-width 250ms cubic-bezier(0.33, 0, 0.67, 1);
}
.node-group:not(.node-hovered):not(.node-neighbor) .node-glow {
  transition: stroke-opacity 250ms cubic-bezier(0.33, 0, 0.67, 1),
              stroke-width 250ms cubic-bezier(0.33, 0, 0.67, 1),
              transform 250ms cubic-bezier(0.33, 0, 0.67, 1);
}
.node-group:not(.node-hovered):not(.node-neighbor) .node-inner {
  transition: transform 250ms cubic-bezier(0.33, 0, 0.67, 1);
}

.graph-edge:not(.edge-hover-bright):not(.edge-hover-2):not(.edge-hover-dim) {
  transition: stroke-opacity 250ms cubic-bezier(0.33, 0, 0.67, 1),
              stroke-width 250ms cubic-bezier(0.33, 0, 0.67, 1);
}

/* ── End Hover Animation System ──────────────────────── */

.node-label {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  fill: rgba(255, 255, 255, 0.95);
  pointer-events: none;
  text-anchor: middle;
  dominant-baseline: central;
  stroke: rgba(0, 0, 0, 0.7);
  stroke-width: 2.5px;
  paint-order: stroke fill;
  stroke-linejoin: round;
  transition: fill 220ms ease-in,
              opacity 220ms ease-in;
}

.node-label.visible {
  fill: rgba(232, 244, 253, 0.95);
}

/* Filter dimming (category/sector selection) */
.node-group.dimmed .node-circle {
  opacity: 0.1;
}

.node-group.dimmed .node-label {
  opacity: 0.05;
}

/* ─── Graph Controls ────────────────────────────────────── */
#graph-controls {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.graph-ctrl-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 8, 18, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-card);
}

.graph-ctrl-btn:hover {
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--border-glow);
  color: var(--tao-cyan);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.2);
}

/* ─── Loading State ─────────────────────────────────────── */
#graph-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 15;
  background: rgba(0, 0, 0, 0.8);
  transition: opacity 0.5s ease;
}

#graph-loading.fade-out {
  opacity: 0;
  pointer-events: none;
}

#graph-loading.removed {
  display: none;
}

.loading-ring {
  width: 50px;
  height: 50px;
  border: 2px solid rgba(0, 212, 255, 0.15);
  border-top-color: var(--tao-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
}

/* ─── Mini Zoom Indicator ──────────────────────────────── */
#zoom-indicator {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  pointer-events: none;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#zoom-indicator.visible { opacity: 1; }

/* ─── Sector Bar ─────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════
   TWO-ROW FILTER SYSTEM
   Row 1: SECTOR FILTERS (Primary — controls graph highlighting)
   Row 2: SECTOR RANKINGS (Secondary — controls ranking panel)
═══════════════════════════════════════════════════════════════ */

#filter-system {
  position: absolute;
  top: 54px;
  left: 0;
  right: 0;
  z-index: 30;
  display: none;
  flex-direction: column;
  transition: right 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

#graph-view.active #filter-system {
  display: flex;
}

/* ── Shared row layout ── */
.filter-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 1.5rem;
}

/* ── ROW 1: Primary (Sector Filters) ── */
.filter-row--primary {
  padding-top: 0.5rem;
  padding-bottom: 0.45rem;
  background: linear-gradient(
    180deg,
    rgba(2, 6, 16, 0.97) 0%,
    rgba(4, 10, 24, 0.94) 100%
  );
  backdrop-filter: blur(14px);
  border-bottom: none;
}

/* ── Neon divider line between rows ── */
.filter-row-divider {
  height: 1px;
  margin: 0 1.5rem;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 212, 255, 0.25) 15%,
    rgba(0, 212, 255, 0.4) 50%,
    rgba(123, 104, 238, 0.25) 85%,
    transparent 100%
  );
  box-shadow: 0 0 6px rgba(0, 212, 255, 0.15);
}

/* ── ROW 2: Secondary (Sector Rankings) ── */
.filter-row--secondary {
  padding-top: 0.35rem;
  padding-bottom: 0.4rem;
  background: linear-gradient(
    180deg,
    rgba(2, 4, 12, 0.92) 0%,
    rgba(2, 6, 16, 0.88) 100%
  );
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

/* ── Row labels ── */
.filter-row-label {
  font-family: var(--font-display);
  font-size: 0.55rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

.filter-row-label--secondary {
  font-weight: 600;
  font-size: 0.48rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.2em;
  text-shadow: none;
}

/* ── Pill container (shared) ── */
.filter-row-pills {
  display: flex;
  gap: 0.35rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1;
  padding: 0.1rem 0;
}

.filter-row-pills::-webkit-scrollbar { display: none; }

/* ── PRIMARY pills (larger, stronger glow) ── */
.filter-row--primary .sector-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 0.32rem 0.72rem;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 180ms ease;
  flex-shrink: 0;
}

.filter-row--primary .sector-pill:hover {
  border-color: var(--border-glow);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.07);
}

.filter-row--primary .sector-pill.active {
  color: #000;
  font-weight: 600;
  border-color: transparent;
}

.filter-row--primary .sector-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── SECONDARY pills (smaller, outlined, softer) ── */
.filter-row--secondary .sector-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 400;
  white-space: nowrap;
  padding: 0.2rem 0.55rem;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: transparent;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: all 180ms ease;
  flex-shrink: 0;
}

.filter-row--secondary .sector-pill:hover {
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.03);
}

/* Secondary active pill gets a glowing underline accent */
.filter-row--secondary .sector-pill.active {
  font-weight: 500;
  border-color: currentColor;
  background: rgba(255, 255, 255, 0.05);
  position: relative;
}

.filter-row--secondary .sector-pill.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 15%;
  right: 15%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  box-shadow: 0 0 6px currentColor;
}

.filter-row--secondary .sector-pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.7;
}

/* Secondary row is always interactive — no muted state */
/* Removed: .filter-row--secondary.muted .sector-pill */

/* Rankings hint */
.rankings-hint {
  font-family: var(--font-body);
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.28);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.05em;
  font-style: italic;
}

.rankings-hint.hidden {
  display: none;
}

/* ─── Reset Button: Inactive (muted) ─── */
.sector-reset-btn {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-dim);
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.25rem 0.7rem;
  cursor: default;
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 0.4;
  pointer-events: none;
  transition: opacity 0.3s ease, color 0.2s ease, border-color 0.2s ease,
              box-shadow 0.2s ease, transform 0.18s ease-out, background 0.2s ease;
}

/* ─── Reset Button: Active (filters applied) ─── */
.sector-reset-btn.has-active {
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
  color: var(--tao-cyan);
  border-color: rgba(0, 212, 255, 0.45);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.15), 0 0 2px rgba(0, 212, 255, 0.1);
  animation: resetBreathe 2.8s ease-in-out infinite;
}

@keyframes resetBreathe {
  0%, 100% {
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.15), 0 0 2px rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.25), 0 0 4px rgba(0, 212, 255, 0.15);
    border-color: rgba(0, 212, 255, 0.55);
  }
}

/* ─── Reset Button: Hover (active only) ─── */
.sector-reset-btn.has-active:hover {
  color: #fff;
  border-color: rgba(0, 212, 255, 0.7);
  background: rgba(0, 212, 255, 0.1);
  box-shadow: 0 0 14px rgba(0, 212, 255, 0.3), 0 0 4px rgba(0, 212, 255, 0.2);
  transform: scale(1.03);
  animation: none;
}

/* ─── Reset Button: Click flash ─── */
.sector-reset-btn.reset-flash {
  background: rgba(0, 212, 255, 0.25) !important;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.4), 0 0 6px rgba(0, 212, 255, 0.3) !important;
  color: #fff !important;
  transition: none !important;
}

/* Sector-based graph node states */
.node-group .node-circle,
.node-group .node-label,
.node-group .node-glow {
  will-change: opacity;
  transition: opacity 300ms ease, stroke-opacity 300ms ease;
}

.node-group.sector-dimmed .node-circle {
  opacity: 0.12;
  filter: saturate(0.2);
}

.node-group.sector-dimmed .node-label {
  opacity: 0.08;
}

.node-group.sector-dimmed .node-glow {
  stroke-opacity: 0.02 !important;
}

/* Ensure highlighted nodes have smooth transitions too */
.node-group.sector-highlighted .node-circle {
  opacity: 1;
  filter: brightness(1.2) saturate(1.3);
}

.node-group.sector-highlighted .node-label {
  opacity: 1;
}

@keyframes sectorPulse {
  0%, 100% { stroke-opacity: 0.35; }
  50%       { stroke-opacity: 0.65; }
}

.node-group.sector-highlighted .node-glow {
  stroke-opacity: 0.5;
  animation: sectorPulse 2s ease-in-out infinite;
}

.graph-edge.sector-dimmed {
  stroke-opacity: 0.03 !important;
  transition: stroke-opacity 300ms ease;
}

/* ─── Sector Rankings Panel ──────────────────────────── */
#sector-rankings {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 28;
  width: 360px;
  max-width: 100%;
  background: rgba(2, 6, 14, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 1px solid rgba(0,212,255,0.1);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 400ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -20px 0 60px rgba(0,0,0,0.7);
  overflow: hidden;
  will-change: transform;
}

#sector-rankings.open {
  transform: translateX(0);
}

/* Header */
.sr-header {
  padding: 1rem 1.25rem;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(0,212,255,0.07);
}

.sr-header-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.sr-sector-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  background: var(--tao-cyan);
  box-shadow: 0 0 12px rgba(0,212,255,0.5);
  transition: background 300ms ease, box-shadow 300ms ease;
}

.sr-header-info {
  flex: 1;
  min-width: 0;
}

.sr-sector-name {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--tao-cyan);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(0,212,255,0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sr-count {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  margin-top: 0.1rem;
}

.sr-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(0,212,255,0.15);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.sr-close:hover {
  background: rgba(0,212,255,0.1);
  border-color: var(--border-glow);
  color: var(--tao-cyan);
}

.sr-glow-bar {
  height: 2px;
  margin-top: 0.75rem;
  border-radius: 1px;
  background: linear-gradient(90deg, var(--tao-cyan), transparent);
  transition: background 300ms ease;
}

/* Stats */
.sr-stats {
  display: flex;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(0,212,255,0.07);
}

.sr-stat-block {
  flex: 1;
  padding: 0.6rem 1.25rem;
  border-right: 1px solid rgba(0,212,255,0.07);
}

.sr-stat-block:last-child {
  border-right: none;
}

.sr-stat-label {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.sr-stat-val {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--tao-cyan);
  text-shadow: 0 0 8px rgba(0,212,255,0.4);
  line-height: 1;
}

/* Sort bar */
/* List */
.sr-list-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,212,255,0.2) transparent;
}

.sr-list-wrap::-webkit-scrollbar { width: 3px; }
.sr-list-wrap::-webkit-scrollbar-track { background: transparent; }
.sr-list-wrap::-webkit-scrollbar-thumb {
  background: rgba(0,212,255,0.2);
  border-radius: 2px;
}

.sr-list {
  display: flex;
  flex-direction: column;
}

/* Row */
.sr-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0 0.6rem;
  padding: 0.65rem 1.25rem;
  cursor: pointer;
  transition: all 150ms ease;
  border-bottom: 1px solid rgba(0,212,255,0.04);
  position: relative;
  opacity: 0;
  transform: translateX(20px);
  animation: srRowIn 0.3s ease-out forwards;
  align-items: center;
}

@keyframes srRowIn {
  to { opacity: 1; transform: translateX(0); }
}

.sr-row:hover {
  background: rgba(0,212,255,0.06);
}

.sr-row:hover .sr-subnet-name {
  color: var(--tao-cyan);
}

.sr-row.hovered {
  background: rgba(0,212,255,0.1);
  border-left: 2px solid var(--tao-cyan);
  padding-left: calc(1.25rem - 2px);
}

/* Row grid items */
.sr-rank {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  text-align: center;
  align-self: center;
}

.sr-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.sr-name-line {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.sr-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sr-subnet-name {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 150ms ease;
  min-width: 0;
}

.sr-sn-badge {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-dim);
  background: rgba(255,255,255,0.05);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  flex-shrink: 0;
  white-space: nowrap;
}

.sr-metrics-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sr-mcap {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--tao-cyan);
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  #detail-panel {
    width: 100%;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70vh;
    border-left: none;
    border-top: 1px solid var(--border-subtle);
    transform: translateY(100%);
  }

  #detail-panel.open {
    transform: translateY(0);
  }

  .filter-chips { display: none; }
  .landing-stats { gap: 1.5rem; }
  .stat-value { font-size: 1.2rem; height: 1.6rem; }
}

@media (max-width: 480px) {
  .landing-stats { flex-wrap: wrap; justify-content: center; }
  .cta-btn { width: 100%; justify-content: center; }
}

/* ─── Utility animations ─────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
  animation: fadeInUp 0.4s ease-out both;
}

/* Node pulse animation for selected state */
@keyframes nodePulse {
  0%, 100% { filter: brightness(1.2) drop-shadow(0 0 6px currentColor); }
  50%       { filter: brightness(1.6) drop-shadow(0 0 16px currentColor); }
}

.node-selected .node-circle {
  animation: nodePulse 1.5s ease-in-out infinite;
}

/* ============================================================
   LIVING INTELLIGENCE TERMINAL — PHASE 1 CSS ADDITIONS
   ============================================================ */

/* ─── Utility: hidden ────────────────────────────────────── */
.hidden { display: none !important; }

/* ─── J) Visual Hierarchy: Enhanced Filter Rows ─────────── */

/* Row 1 label: pure white, larger */
.filter-row--primary .filter-row-label {
  color: #ffffff;
  font-size: 0.60rem;
  text-shadow: 0 0 12px rgba(0, 212, 255, 0.5), 0 0 24px rgba(0, 212, 255, 0.2);
  letter-spacing: 0.26em;
}

/* Row 1 pills: slightly larger */
.filter-row--primary .sector-pill {
  padding: 0.38rem 0.82rem;
  font-size: 0.75rem;
}

/* Row 1 active pill: stronger glow */
.filter-row--primary .sector-pill.active {
  box-shadow: 0 0 14px currentColor, 0 0 28px rgba(0, 212, 255, 0.2) !important;
  filter: brightness(1.1);
}

/* Enhanced divider */
.filter-row-divider {
  height: 2px;
  margin: 3px 1.5rem;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 212, 255, 0.35) 10%,
    rgba(0, 212, 255, 0.6) 40%,
    rgba(123, 104, 238, 0.5) 60%,
    rgba(0, 212, 255, 0.35) 90%,
    transparent 100%
  );
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.25), 0 0 20px rgba(0, 212, 255, 0.1);
}

/* Row 2 label: smaller/dimmer */
.filter-row--secondary .filter-row-label {
  font-size: 0.45rem;
  color: rgba(255, 255, 255, 0.45);
}

/* Row 2 pills: thinner outline */
.filter-row--secondary .sector-pill {
  border-width: 1px;
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.06);
  font-size: 0.58rem;
  padding: 0.18rem 0.5rem;
}

/* ─── B) Heat Mode ───────────────────────────────────────── */
.node-group.heat-boosted .node-circle {
  filter: brightness(1.4) !important;
}
.node-group.heat-dim .node-circle {
  opacity: 0.35 !important;
}
.graph-edge.heat-faded {
  stroke-opacity: 0.04 !important;
  transition: stroke-opacity 400ms ease;
}

/* ─── L) Focus Mode ──────────────────────────────────────── */
.node-group.focus-dim {
  opacity: 0.18 !important;
  transition: opacity 350ms ease;
}
.node-group.focus-bright {
  opacity: 1 !important;
  transition: opacity 350ms ease;
}
.graph-edge.focus-dim {
  stroke-opacity: 0.04 !important;
  transition: stroke-opacity 350ms ease;
}



/* ─── Time Travel Bar ────────────────────────────────────── */
#time-travel-bar {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(4, 8, 18, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  padding: 0.35rem 0.9rem;
  box-shadow: var(--shadow-card);
}

.tt-label {
  font-size: 0.75rem;
  opacity: 0.5;
}

.tt-slider {
  width: 150px;
  height: 3px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(90deg, var(--tao-cyan) 0%, rgba(0, 212, 255, 0.2) 100%);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.tt-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--tao-cyan);
  box-shadow: 0 0 6px rgba(0, 212, 255, 0.6);
  cursor: pointer;
}

.tt-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--tao-cyan);
  box-shadow: 0 0 6px rgba(0, 212, 255, 0.6);
  cursor: pointer;
  border: none;
}

.tt-period {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--tao-cyan);
  min-width: 50px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* ─── Dominance Pill ─────────────────────────────────────── */
.dominance-pill {
  position: absolute;
  top: 130px;
  right: 1.5rem;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 100px;
  padding: 0.4rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-secondary);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.1);
  animation: pillGlow 2.5s ease-in-out infinite;
}

@keyframes pillGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(0, 212, 255, 0.1); }
  50% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.25); }
}

.dominance-pill .dp-sep { color: var(--text-dim); font-size: 0.55rem; }
#dp-cap { color: var(--tao-cyan); font-weight: 600; }
#dp-dom { color: #FFD700; }

/* ─── Compare Card ───────────────────────────────────────── */
.compare-card {
  position: absolute;
  top: 168px;
  right: 1.5rem;
  z-index: 25;
  width: 320px;
  background: rgba(4, 8, 18, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card), 0 0 20px rgba(0, 212, 255, 0.05);
  overflow: hidden;
  transition: max-height 350ms cubic-bezier(0.4, 0, 0.2, 1),
              opacity 250ms ease;
}

.compare-card.entering {
  animation: compareSlideIn 280ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes compareSlideIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.compare-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  background: rgba(0, 212, 255, 0.04);
  border-bottom: 1px solid var(--border-subtle);
}

.compare-card-title {
  font-family: var(--font-display);
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--tao-cyan);
  letter-spacing: 0.2em;
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

.compare-toggle-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0.1rem 0.3rem;
  transition: transform 250ms ease, color 150ms ease;
}
.compare-toggle-btn:hover { color: var(--tao-cyan); }
.compare-card.collapsed .compare-toggle-btn { transform: rotate(180deg); }

.compare-card-body {
  overflow: hidden;
  max-height: 400px;
  transition: max-height 350ms cubic-bezier(0.4, 0, 0.2, 1),
              padding 350ms ease;
  padding: 0.5rem;
}

.compare-card.collapsed .compare-card-body {
  max-height: 0;
  padding: 0;
}

.compare-sector-block {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.4rem;
}

.compare-sector-name {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.compare-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.compare-stats {
  display: flex;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.compare-stat-val { color: var(--tao-cyan); font-weight: 600; }

.compare-top-subnets {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-top: 0.3rem;
}

.compare-subnet-chip {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.1rem 0.35rem;
}

/* ─── E) Premium Micro-Card Tooltip ─────────────────────── */
#tooltip.micro-card {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  max-width: 260px;
  transform: translate(14px, -50%);
  transition: opacity 140ms cubic-bezier(0.4, 0, 0.2, 1),
              transform 140ms cubic-bezier(0.4, 0, 0.2, 1);
}

#tooltip.micro-card.visible {
  opacity: 1;
}

.mc-inner {
  background: rgba(4, 8, 20, 0.98);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: var(--radius-lg);
  padding: 0.75rem 0.9rem;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.7),
    0 0 20px rgba(0, 212, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.mc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.mc-sn-id {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
}

.mc-rank-badge {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--tao-cyan);
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 100px;
  padding: 0.05rem 0.4rem;
}

.mc-name {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 0.35rem;
}

.mc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.45rem;
}

.mc-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--bg-void);
  padding: 0.12rem 0.45rem;
  border-radius: 100px;
}

.mc-tag-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mc-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.mc-metric {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.mc-metric-label {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mc-metric-val {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--tao-cyan);
}

.mc-desc {
  font-family: var(--font-body);
  font-size: 0.68rem;
  color: var(--text-secondary);
  line-height: 1.4;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.35rem;
  margin-top: 0.1rem;
}

/* ─── K) Selection Wave ──────────────────────────────────── */
@keyframes selectionWavePulse {
  0%   { filter: brightness(2.5) drop-shadow(0 0 10px currentColor); }
  100% { filter: brightness(1) drop-shadow(0 0 0px transparent); }
}

.node-group.selection-wave .node-circle {
  animation: selectionWavePulse 0.65s ease-out forwards;
}

/* ─── G) Smart Dynamic Summary ───────────────────────────── */
.node-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

.node-count strong {
  color: var(--tao-cyan);
  font-weight: 500;
}

/* ─── A) Edge Shimmer ────────────────────────────────────── */
@keyframes edgeShimmer {
  0%   { stroke-opacity: var(--base-opacity, 0.25); }
  50%  { stroke-opacity: 0.7; filter: drop-shadow(0 0 2px currentColor); }
  100% { stroke-opacity: var(--base-opacity, 0.25); }
}

.graph-edge.shimmer {
  animation: edgeShimmer 0.9s ease-in-out forwards;
}

/* ─── I) Time Travel node tinting ───────────────────────── */
.node-group.tt-past-faded .node-circle {
  filter: brightness(0.55) saturate(0.6) !important;
  transition: filter 400ms ease;
}

/* ─── F) Depth perception: parallax canvas ──────────────── */
/* canvas moves via JS inline style — no extra CSS needed */


/* ─── Energy Pulse Overlay ─────────────────────────────── */
#energy-pulse-group {
  pointer-events: none;
}
