#ai-narrative-panel {
  position: absolute;
  top: 60px;
  left: 20px;
  width: 340px;
  max-height: calc(100vh - 180px);
  background: rgba(2, 6, 23, 0.88);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 12px;
  backdrop-filter: blur(16px);
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.1), inset 0 1px 0 rgba(255,255,255,0.04);
  z-index: 60;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
  overflow: hidden;
}

#ai-narrative-panel.visible {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.ai-narrative-header {
  padding: 10px 14px;
  font-family: 'Orbitron', 'Inter', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #67e8f9;
  border-bottom: 1px solid rgba(6, 182, 212, 0.15);
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 0 8px rgba(6, 182, 212, 0.5);
}

.ai-header-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 6px #34d399;
  animation: ai-dot-pulse 1.5s ease-in-out infinite;
}

@keyframes ai-dot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.ai-narrative-body {
  padding: 12px 14px;
  overflow-y: auto;
  flex: 1;
  max-height: calc(100vh - 260px);
  scrollbar-width: thin;
  scrollbar-color: rgba(6,182,212,0.2) transparent;
}

.ai-narrative-body::-webkit-scrollbar { width: 4px; }
.ai-narrative-body::-webkit-scrollbar-track { background: transparent; }
.ai-narrative-body::-webkit-scrollbar-thumb { background: rgba(6,182,212,0.25); border-radius: 2px; }

.ai-phase-header {
  font-family: 'Orbitron', 'Inter', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #94a3b8;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: ai-line-appear 0.3s ease-out;
}

.ai-phase-line {
  font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  font-size: 10.5px;
  line-height: 1.6;
  color: #cbd5e1;
  padding-left: 16px;
  animation: ai-line-appear 0.25s ease-out;
}

@keyframes ai-line-appear {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  #ai-narrative-panel {
    width: min(280px, calc(100vw - 20px));
    top: 50px;
    left: 10px;
    font-size: 9px;
  }

  .ai-phase-line { font-size: 9px; }
}
